argparse
argparse copied to clipboard
Bypass `Unknown Argument:` exception?
I'm working with an application which has to pass arguments to subprocesses. As such, there are upwards of hundreds of possible arguments that could be done as passthrough, but when I try to pass an argument that isn't explicitly defined, parse_args() gives up. I can catch the initial exception, but fetching the arguments later on throw Nothing parsed, no arguments are available..
Is it somehow possible to get argparse to ignore arguments it doesn't recognize?
No, argparse will not ignore unrecognized arguments since v1.6.
I recommend leaving this issue open. Someone may see this and decide to add parse_known_args.