Feature Request: ignore (or extract) not specified extra options instead of fail
Author: ncolomerCreated Oct 16, 2019Updated Dec 20, 2023
Hi there,
It would be great to be able to ignore not specified options when parsing arguments.
My use case is that some runtime invokes my python script with additional options for which I don't have any control. I'd just like to ignore them.
For instance, if I use the naval fate example from README.md, I'd like the following command to be valid:
naval_fate.py ship shoot 1 2 --unwanted-optionnaval_fate.py ship --unwanted-option shoot 1 2naval_fate.py --unwanted-option ship shoot 1 2
Another idea would be to, instead of ignoring them, simply extract them in another dict as the argparse library do via the parse_known_args method.
Source: docopt/docopt