2017-07-13 13:12:41 +08:00
|
|
|
# No args is an error
|
|
|
|
argparse: No option specs were provided
|
|
|
|
# Missing -- is an error
|
|
|
|
argparse: Missing -- separator
|
|
|
|
# Flags but no option specs is an error
|
|
|
|
argparse: No option specs were provided
|
|
|
|
# Invalid option specs
|
|
|
|
argparse: Invalid option spec 'h-' at char '-'
|
2017-07-14 11:36:59 +08:00
|
|
|
argparse: Short flag '+' invalid, must be alphanum or '#'
|
2017-07-13 13:12:41 +08:00
|
|
|
argparse: Invalid option spec 'h/help:' at char ':'
|
|
|
|
argparse: Invalid option spec 'h-help::' at char ':'
|
|
|
|
argparse: Invalid option spec 'h-help=x' at char 'x'
|
|
|
|
# --max-args and --min-args work
|
|
|
|
min-max: Expected at least 1 args, got only 0
|
|
|
|
min-max: Expected at most 3 args, got 4
|
|
|
|
min-max: Expected at most 1 args, got 2
|
2017-07-14 11:36:59 +08:00
|
|
|
# Invalid "#-val" spec
|
|
|
|
argparse: Short flag '#' does not allow modifiers like '='
|
|
|
|
# Invalid arg in the face of a "#-val" spec
|
|
|
|
argparse: Unknown option '-x'
|
|
|
|
Standard input (line 38):
|
|
|
|
argparse '#-val' -- abc -x def
|
|
|
|
^
|