From: Zoran Zaric Date: Sat, 26 Jan 2013 18:44:34 +0000 (+0100) Subject: Print a more meaningful error message when help can't run man. X-Git-Tag: bup-0.25-rc2~82 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;ds=sidebyside;h=8c15ca91a77067e3e076d590cf7c2f2d1519afa5;p=bup.git Print a more meaningful error message when help can't run man. Signed-off-by: Zoran Zaric [rlb@defaultvalue.org: elaborated on the error message a bit] Signed-off-by: Rob Browning --- diff --git a/cmd/help-cmd.py b/cmd/help-cmd.py index c2b84c8..56a4148 100755 --- a/cmd/help-cmd.py +++ b/cmd/help-cmd.py @@ -16,9 +16,13 @@ elif len(extra) == 1: 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")