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.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/patman/tools.py b/tools/patman/tools.py
index 877e37cd8d..96882264a2 100644
--- a/tools/patman/tools.py
+++ b/tools/patman/tools.py
@@ -581,3 +581,16 @@ def ToHexSize(val):
hex value of size, or 'None' if the value is None
"""
return 'None' if val is None else '%#x' % len(val)
+
+def PrintFullHelp(fname):
+ """Print the full help message for a tool using an appropriate pager.
+
+ Args:
+ fname: Path to a file containing the full help message
+ """
+ pager = os.getenv('PAGER')
+ if not pager:
+ pager = shutil.which('less')
+ if not pager:
+ pager = 'more'
+ command.Run(pager, fname)