Skip to content
Browse files

Print a more meaningful error message when help can't run man.

Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
[rlb@defaultvalue.org: elaborated on the error message a bit]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
  • Loading branch information...
1 parent 5169103 commit 8c15ca91a77067e3e076d590cf7c2f2d1519afa5 @zoranzaric zoranzaric committed with rlbdv Jan 26, 2013
Showing with 8 additions and 4 deletions.
  1. +8 −4 cmd/help-cmd.py
View
12 cmd/help-cmd.py
@@ -16,9 +16,13 @@
manpath = os.path.join(path.exedir(),
'Documentation/' + docname + '.[1-9]')
g = glob.glob(manpath)
- if g:
- os.execvp('man', ['man', '-l', g[0]])
- else:
- os.execvp('man', ['man', docname])
+ try:
+ if g:
+ os.execvp('man', ['man', '-l', g[0]])
+ else:
+ os.execvp('man', ['man', docname])
+ except OSError, e:
+ sys.stderr.write('Unable to run man command: %s\n' % e)
+ sys.exit(1)
else:
o.fatal("exactly one command name expected")

0 comments on commit 8c15ca9

Please sign in to comment.
Something went wrong with that request. Please try again.