Let's say the user types:
./args.py --create --mem 5
and my parser looks like this:
parser.add_argument('--create', nargs='*', default=None)
Normally --create
takes a list with nargs='*'
, however in this case the user passed nothing.
What I would like to happen is that --create
is set to the default value when invoked, instead I get []
Question: Is there anyway to detect if --create
shows up in the command line arguments without anything after it?