diff options
-rwxr-xr-x | gbp/scripts/command.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gbp/scripts/command.py b/gbp/scripts/command.py index c6ae493..a3cb657 100755 --- a/gbp/scripts/command.py +++ b/gbp/scripts/command.py @@ -53,12 +53,17 @@ def gbp_command(argv=None): cmd = argv[1] args = argv[1:] - cmd = sanitize(cmd) + if cmd in ['--help', '-h']: + usage() + return 0 + + modulename = sanitize(cmd) try: - module = import_command(cmd) + module = import_command(modulename) except ImportError as e: print >>sys.stderr, "'%s' is not a valid command." % cmd - if '--debug' in args: + usage() + if '--verbose' in args: print >>sys.stderr, e return 2 |