summaryrefslogtreecommitdiff
path: root/tools/patman/tools.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/patman/tools.py')
-rw-r--r--tools/patman/tools.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/patman/tools.py b/tools/patman/tools.py
index 96882264a2f..710f1fdcd36 100644
--- a/tools/patman/tools.py
+++ b/tools/patman/tools.py
@@ -5,6 +5,7 @@
import glob
import os
+import shlex
import shutil
import struct
import sys
@@ -588,9 +589,10 @@ def PrintFullHelp(fname):
Args:
fname: Path to a file containing the full help message
"""
- pager = os.getenv('PAGER')
+ pager = shlex.split(os.getenv('PAGER', ''))
if not pager:
- pager = shutil.which('less')
+ lesspath = shutil.which('less')
+ pager = [lesspath] if lesspath else None
if not pager:
- pager = 'more'
- command.Run(pager, fname)
+ pager = ['more']
+ command.Run(*pager, fname)