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>
manpath = os.path.join(path.exedir(),
'Documentation/' + docname + '.[1-9]')
g = glob.glob(manpath)
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")
else:
o.fatal("exactly one command name expected")