0

Is it possible to make argp ignore unknown parameters?
I tried using ARGP_NO_ERRS, but in addition to the fact that, along with the errors, also disables the printouts of the help, the first unknown parameter interrupts the parsing.
If, for example, my parameter was -a, and the command line was

$ myProg -c -b -a

the -a parameter is never parsed, because the parsing stops at -c

mastupristi
  • 1,240
  • 1
  • 13
  • 29
  • You can't parse unknown options in general because you don't know if they take arguments. For example, if `-c` doesn't take an argument but `-b` does, then `myProg` sees your call as two options: `-c` (no argument) and `-b` (argument: `-a`). – melpomene Aug 31 '18 at 06:48
  • @melpomene the idea I have is to have the command line parsed ignoring everything except the parameter -a with its argument. Then, at a later stage, I would re-call argp (with the full set of parameters) to decode the rest of the command line – mastupristi Aug 31 '18 at 19:37
  • You don't know which parts of the command line are options and which are arguments to other options. – melpomene Aug 31 '18 at 21:34

0 Answers0