2017-08-05 03:01:16 +08:00
|
|
|
|
|
|
|
####################
|
|
|
|
# No args is an error
|
|
|
|
|
|
|
|
####################
|
|
|
|
# No short flag or an invalid short flag is an error
|
|
|
|
|
|
|
|
####################
|
|
|
|
# A required and optional arg makes no sense
|
|
|
|
|
|
|
|
####################
|
|
|
|
# A repeated and optional arg makes no sense
|
|
|
|
|
|
|
|
####################
|
|
|
|
# An unexpected arg not associated with a flag is an error
|
|
|
|
|
|
|
|
####################
|
|
|
|
# Bool, short only
|
2017-07-10 11:03:26 +08:00
|
|
|
h
|
2017-08-05 03:01:16 +08:00
|
|
|
|
|
|
|
####################
|
|
|
|
# Bool, short and long
|
2017-07-10 11:03:26 +08:00
|
|
|
h/help
|
2017-08-05 03:01:16 +08:00
|
|
|
|
|
|
|
####################
|
|
|
|
# Bool, short and long but the short var cannot be used
|
2017-07-10 11:03:26 +08:00
|
|
|
h-help
|
2017-08-05 03:01:16 +08:00
|
|
|
|
|
|
|
####################
|
|
|
|
# Required val, short and long but the short var cannot be used
|
2017-07-10 11:03:26 +08:00
|
|
|
h-help=
|
2017-08-05 03:01:16 +08:00
|
|
|
|
|
|
|
####################
|
|
|
|
# Optional val, short and long valid
|
2017-07-10 11:03:26 +08:00
|
|
|
h/help=?
|
2017-08-05 03:01:16 +08:00
|
|
|
|
|
|
|
####################
|
|
|
|
# Optional val, short and long but the short var cannot be used
|
2017-07-10 11:03:26 +08:00
|
|
|
h-help=?
|
2017-08-05 03:01:16 +08:00
|
|
|
|
|
|
|
####################
|
|
|
|
# Repeated val, short and long valid
|
2017-07-10 11:03:26 +08:00
|
|
|
h/help=+
|
2017-08-05 03:01:16 +08:00
|
|
|
|
|
|
|
####################
|
|
|
|
# Repeated val, short and long but short not valid
|
2017-07-10 11:03:26 +08:00
|
|
|
h-help=+
|
2017-08-05 03:01:16 +08:00
|
|
|
|
|
|
|
####################
|
|
|
|
# Repeated val, short only
|
2017-07-10 11:03:26 +08:00
|
|
|
h=+
|
|
|
|
h=+
|