When I use Python's argparse or optparse command line argument parser, any unique prefix of an argument is considered valid, e.g.
$ ./buildall.py --help
usage: buildall.py [-h] [-f]
Build all repositories
optional arguments:
-h, --help show this help message and exit
-f, --force Build dirty repositories
works with --help
, --hel
, --he
for the help option as well as --forc
and --fo
for the force option.
Can this behavior be turned off somehow? I want to get an error message for incomplete arguments.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…