[C] Preferred way to parse command line arguments/parameters?
Hey!
I haven't programmed in a while, but I'm currently looking into writing a command line application for linux. I'll be using C or C++, and I'd like to know, if there is a nice way to parse the command line arguments in the program. I've seen some tutorials suggest the use of argv/argc directly while others suggest to use headers like getopt, and yet another suggests to use an external library. I'd like to stick to ease of use, but I don't want any new dependencies for my app.
Are there any standard/recommended/popular ways to parse command line parameters in C (or C++)? I just need some directions/hints/suggestions.
You know, the likes of:
someapp -j manual -u 23 --folder '/home/user/somefolder' -v --skip-tests -n
Regards!
|