For example:
import argparse
parser = arparse.ArgumentParser()
# parser.add_argument(...) ...
args = parser.parse_args(args_list)
The problem is, parser.parse_args
automatically exits if there is an error in args_list
. Is there a setting that gets it to raise a friendlier exception instead? I do not want to have to catch a SystemExit
and extract the needed error message from it if there is any way around it.