diff options
Diffstat (limited to 'libbe/ui/command_line.py')
-rw-r--r-- | libbe/ui/command_line.py | 9 |
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) |