I need my program to get several arguments from command line, the syntax is as follows:
getpwd -l user1 user2 ... -L -X -S...
So, I need to get
I wrote a C library(GPL license) for parsing command line arguments:
https://github.com/Vincenzo1968/myoptParser
https://github.com/Vincenzo1968/myoptParser/blob/master/how_to_use.md
You can specify the minimum and the maximum number of arguments that option accepts. You can also specify that an option takes zero or more arguments (or one or more, two or more, and so on). And, of course, you can specify a fixed number of arguments: zero, one, two, and so on.
You can also specify the type of the arguments: string, integer or float. The parser checks that the number and type specified matches and, otherwise, it returns an error.
The parser also allows you to specify whether an option is required or not. You can finally specify the mutually exclusive options.