Parsing command line arguments

Hello ofCommunity,
has anyone ever worked with command line parsers?
Any libs or addons you can suggest? I just found ofxArgs and ofxArgParser, but i am more interested in something like tclap. Tclap is header-only and looks quite promising.
I know that there is boost::program_options and Poco::Util:Option, but i haven’t worked with poco, and i don’t wanna use boost.
How are you parsing command line arguments?
Thomas

I like poco::util::option – it’s fairly intuitive and since we have poco already, it’s minimal work to get up and running.

here’s an example of it in action (sorry about the janky formatting) : https://github.com/openframeworks/projectGenerator/blob/master/commandLine/src/main.cpp

I use Tclap but I didn’t know that Poco already had this. I think I’ll move over to Poco::Util now!

FWIW here’s how I use tclap: https://github.com/danomatika/Visual/blob/master/src/Config.cpp#L38

Thanks for your answers and code references.
I think I am going to work with poco::util.
Are there any plans to add command line options as a core feature?

I made a little addon, which basically just includes TCLAP.
https://github.com/thomasgeissl/ofxTclap

I recently transitioned a project from TCLAP to optionsparser.h (The Lean Mean C++ Options Parser). It’s only a single header and formats things more how I like (like gopts), although it’s built around using const structs.

I wrote a wrapper for it which makes working with it closer to TCLAP but with a lot less boilerplate overall: https://github.com/danomatika/cpphelpers/blob/master/Options.h. So 2 headers gives you pretty good parsing :slight_smile:

EDIT: I added functions to drop in an existing options::Descriptor struct.