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
1 changed files with 2 additions and 0 deletions

View File

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