Merge pull request #1 from KrisKennaway/usage

Exit cleanly if no command is provided.
This commit is contained in:
4am 2020-10-02 11:04:30 -04:00 committed by GitHub
commit 45265911ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -971,6 +971,8 @@ See '""" + __progname__ + """ <command> -h' for help on individual commands.""",
sp = parser.add_subparsers(dest="command", help="command") sp = parser.add_subparsers(dest="command", help="command")
for command in cmds: for command in cmds:
command.setup(sp) command.setup(sp)
if not args:
parser.error("Command is required.")
args = parser.parse_args(args) args = parser.parse_args(args)
args.action(args) args.action(args)