Is there a library out there for C++ which parses and handles command line arguments passed to it? Like the optparse module in Python. I'm looking at something called argh(http://iki.fi/bisqwit/) but it has horrible documentation.
Is there a library out there for C++ which parses and handles command line arguments passed to it? Like the optparse module in Python. I'm looking at something called argh(http://iki.fi/bisqwit/) but it has horrible documentation.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
Why not just use argc and argv?
Thanks, Mario! Exactly what I'm looking for.
Manutd: If you've ever used optparse in Python, you probably would never want to go back to handling command line arguments directly.
Never even looked at python
I don't know what kind of programming is your main focus, but if you do a lot of string handling, you really should try Python. And it's not just strings. If you do a lot of mathematical stuff, Python ain't too shabby. It supports big numbers right out of the box and I heard that it is one of the fastest interpreted languages out there (if not the fastest).
One of the things you may find annoying in the library is the MultiSwitchArg choice. Personally, I prefer to have something like -V3 parsed, then -V -V -V for those situations where a valued switch makes sense.
I didn't change the MultiSwitchArg, but added a ValueSwitchArg header to the lib to deal with the former. I've not tested it fully. But if you feel you need something like that, and you don't feel like implementing it yourself (it's quiet easy anyways) let me know and tomorow I'll pass it on.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.