Print error on missing command.

This commit is contained in:
Bastian Kleineidam 2014-06-26 20:54:45 +02:00
parent 16361ba5f4
commit 919ba2b4a5
1 changed files with 4 additions and 1 deletions

5
patool
View File

@ -188,8 +188,11 @@ def main():
try: try:
argparser = create_argparser() argparser = create_argparser()
args = argparser.parse_args() args = argparser.parse_args()
if args.command is None:
# Python 3.3.1 under linux allows an empty command somehow
argparser.error("too few arguments")
# run subcommand function # run subcommand function
return globals()["run_%s" % args.command](args) res = globals()["run_%s" % args.command](args)
except KeyboardInterrupt: except KeyboardInterrupt:
log_error("aborted") log_error("aborted")
res = 1 res = 1