The two basic methods to pass parameters to the main()-routine are: input files and command line arguments. For small scale programs these input methods allow to change parameters without having to recompile or having to create an input file parser. Even for large programs input files and command line arguments are a comfortable way to replace annoying graphical user interfaces. When debugging complicated code, it is essential to be able to isolate code fragments into a lonely main()-routine. In order to feed these isolated code fragments with realistic data, sophisticated command line and input file parsing becomes indispensable.
GetPot allows to parse input files and the command line in a very efficient manner. GetPot itself is a small piece of code, completely contained in a header file. This way the installation is very easy and platform independent. The present article discusses the C++ implementation of GetPot. However, GetPot has been ported to Python, Java and a Ruby. Also, the code has been organized in a way that facilitates porting GetPot to other languages.
Traditionally, programmers relied on the getopt library [Looijaard, 1997] to handle basic command line interpretation. In recognition of the existing getopt library it is brand with an anagram: GetPot. The software as well as this document is distributed under GNU Lesser General Public License1terms (LPGL).