aboutsummaryrefslogtreecommitdiffstats
path: root/libbe
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2010-01-20 07:19:56 -0500
committerW. Trevor King <wking@drexel.edu>2010-01-20 07:19:56 -0500
commit34b5bbd98e420672ecce64ba085bbf1a4205267e (patch)
treeb4f8d1467d5491e613ad5dcf76eb67470c649006 /libbe
parentd5c54945c7d74fab9b41f39ce31ac5f039e864a2 (diff)
downloadbugseverywhere-34b5bbd98e420672ecce64ba085bbf1a4205267e.tar.gz
Add better help message on COMMAND-less be call
Diffstat (limited to 'libbe')
-rw-r--r--libbe/ui/command_line.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/libbe/ui/command_line.py b/libbe/ui/command_line.py
index 7ba6cf5..17f7b35 100644
--- a/libbe/ui/command_line.py
+++ b/libbe/ui/command_line.py
@@ -285,7 +285,14 @@ def main():
except CallbackExit:
return 0
except libbe.command.UserError, e:
- print >> ui.io.stdout, 'ERROR:\n', e
+ if str(e).endswith('COMMAND'):
+ # no command given, print usage string
+ print >> ui.io.stdout, 'ERROR:'
+ print >> ui.io.stdout, be.usage(), '\n', e
+ print >> ui.io.stdout, 'For example, try'
+ print >> ui.io.stdout, ' be help'
+ else:
+ print >> ui.io.stdout, 'ERROR:\n', e
return 1
command_name = args.pop(0)