Skip to content

Commit ffec193

Browse files
committed
err if we can't launch the pager
1 parent fda224b commit ffec193

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

gitless/cli/helpers.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,13 @@ def page(fp, repo):
8888
cmd.extend(['-r', '-f']) # append arguments
8989

9090
cmd.append(fp) # add file name to page command
91-
subprocess.call(cmd, stdin=sys.stdin, stdout=sys.stdout)
91+
try:
92+
ret = subprocess.call(cmd, stdin=sys.stdin, stdout=sys.stdout)
93+
if ret != 0:
94+
pprint.err('Call to pager {0} failed'.format(pager))
95+
except OSError:
96+
pprint.err('Couldn\'t launch pager {0}'.format(pager))
97+
pprint.err_exp('change the value of git\'s core.pager setting')
9298

9399

94100
class PathProcessor(argparse.Action):

0 commit comments

Comments
 (0)