projects
/
be.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d5c5494
)
Add better help message on COMMAND-less be call
author
W. Trevor King
<wking@drexel.edu>
Wed, 20 Jan 2010 12:19:56 +0000
(07:19 -0500)
committer
W. Trevor King
<wking@drexel.edu>
Wed, 20 Jan 2010 12:19:56 +0000
(07:19 -0500)
libbe/ui/command_line.py
patch
|
blob
|
history
diff --git
a/libbe/ui/command_line.py
b/libbe/ui/command_line.py
index 7ba6cf5b20b78ec9159ffce29fdcf348cae3ded3..17f7b35cd50de82bbb059dd71a78d59a07cdf8e1 100644
(file)
--- 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)