I am playing around with argp.h in C but I don't manage to recreate the desired behavior for my CLI.
What I would like is a syntax similar to, e.g., cryptsetup:
Usage: cryptsetup [OPTION...] <action> <action-specific>
Let's say, for example, that I'm writing a program for string manipulation, I'd like a syntax like:
stringmanip --remove-vowels --remove-spaces concat cat dog "green apple"
output: ctdggrnppl
Can argp do this? My understanding is that I could do it with "--concat" rather than just "concat" but that's not what I want, I want to separate really mandatory actions (exactly one of them) from optional args (the program will throw a warning/error if the option is not supported by the given action).
I also looked into cryptsetup's code, but it seems like it implements its own parsing rather than using argp.
Any idea? I'm also open to using other libraries, as long as they're well-known and well-behaved.
Thanks for any useful answer!