Embeds the TCLAP library inside the ecl. This is a very convenient command line parser in templatised c++.
Provides a templatised c++ parser for handling command line arguments. The templates provide a very flexible manner for handling any type of input argument. The code for the command line parser is a simple wrapper around another template header library called <a href="http://tclap.sourceforge.net/">TCLAP</a>. Since it is relatively small, its bundled here in the command_line subdirectory and namespaced in a convenient manner. Licensing terms (MIT) are included in the command_line subdirectory (also included as an install target). @subsection Alternatives A more complicated, but more flexible alternative (it allows argument parsing from both command line and configuration file simultaneously) is the boost::program_options library.
Include the following at the top of any translation unit which requires this library: @code #include <ecl/command_line.hpp> // Interface classes using ecl::CmdLine; using ecl::ArgException // Argument classes using ecl::SwitchArg; using ecl::ValueArg; using ecl::MultiArg; using ecl::UnlabeledValueArg; using ecl::UnlabeledMultiArg; // there are more - see tclap docs @endcode Since it is a template header library, no linking is required if you are only using these classes.
A single object is used to parse the command line. Initialise it with a few default properties. These will be used to automatically generate a –help argument.
Valid argument types include
Custom ValueArg types can be used so long as they implement the >> operator.
Most of tclap's doxygen is generated automatically inside the ecl. For more detailed documentation, read the manual at tclap's home page.
- src/test/command_line.cpp
- src/examples/command_line.cpp
- <b>May 09</b> : wrapper for the tclap headers written. - <b>May 09</b> : initial import of the tclap headers.
Now it's in the ros, at some point in the future I will unwind this back to the original package since it no longer needs to be embedded in the ecl.