summaryrefslogtreecommitdiff
path: root/tools/patman
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2021-02-17 13:41:43 +0300
committerSimon Glass <sjg@chromium.org>2021-03-22 09:23:26 +0300
commitb1b6efc343a5c7b64bdbc0493a16b5e36fb846fb (patch)
tree6ecbecdcc0c00b8d9f251017151306d49e175f90 /tools/patman
parent3a03553aaaaee68c0807867a7ff518146c19d10e (diff)
downloadu-boot-b1b6efc343a5c7b64bdbc0493a16b5e36fb846fb.tar.xz
patman: Use less for help file, if available
It's convenient to be able to scroll up in `patman -H`. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman')
-rwxr-xr-xtools/patman/main.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/patman/main.py b/tools/patman/main.py
index 4e0a3533e9..04e37a5931 100755
--- a/tools/patman/main.py
+++ b/tools/patman/main.py
@@ -9,6 +9,7 @@
from argparse import ArgumentParser
import os
import re
+import shutil
import sys
import traceback
import unittest
@@ -171,6 +172,8 @@ elif args.cmd == 'send':
elif args.full_help:
pager = os.getenv('PAGER')
if not pager:
+ pager = shutil.which('less')
+ if not pager:
pager = 'more'
fname = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),
'README')