summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2013-06-26 16:59:52 +0200
committerGuido Günther <agx@sigxcpu.org>2013-06-26 18:08:23 +0200
commit375014db7fa3981b1b0e071013fb365a3840b32d (patch)
tree6428649d556af4a9e6d4217f56d03dca7fbffbe7
parentb47b7e805641e91e2a9adb46e799ec7a0c07e863 (diff)
gbp: support --help
-rwxr-xr-xgbp/scripts/command.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/gbp/scripts/command.py b/gbp/scripts/command.py
index c6ae493d..a3cb6571 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