]> arthur.barton.de Git - bup.git/commitdiff
Print a more meaningful error message when help can't run man.
authorZoran Zaric <zz@zoranzaric.de>
Sat, 26 Jan 2013 18:44:34 +0000 (19:44 +0100)
committerRob Browning <rlb@defaultvalue.org>
Sun, 27 Jan 2013 17:59:15 +0000 (11:59 -0600)
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>
cmd/help-cmd.py

index c2b84c895044581b4d705f7412bbf0ed7aee468d..56a4148c745d1d2183c80107a07d8b9132146fe2 100755 (executable)
@@ -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")