argtable / argtable3

A single-file, ANSI C, command-line parsing library that parses GNU-style command-line options.
http://www.argtable.org
Other
372 stars 65 forks source link

What is the recommended way to get all the args that have not been matched #73

Open KOLANICH opened 2 years ago

KOLANICH commented 2 years ago

I can try to parse the errors, but it'd be better to split the errors originating from additional args from the errors originating from invalid data.

tomghuang commented 2 years ago

Hi @KOLANICH , I don't quite understand your question. Could you please elaborate more and give some examples to illustrate your question? Thanks.

KOLANICH commented 2 years ago

Here is the "illustration": https://github.com/HydrArgs/HydrArgs/blob/master/backends/argtable3.cpp#L184

My lib is in process of some refactoring, so currently it is in an unworkable state. But the code is still readable.

Other libs often have mechanisms to get such args, like 1 , 2, 3

Getting the unparsed args is essential for implementing subcommands. Instead of integration of specs into a larger parser we just pass the args further and allow them to be parsed by another parser.