]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
patman: Use less for help file, if available
authorNicolas Boichat <drinkcat@chromium.org>
Wed, 17 Feb 2021 10:41:43 +0000 (18:41 +0800)
committerSimon Glass <sjg@chromium.org>
Mon, 22 Mar 2021 06:23:26 +0000 (19:23 +1300)
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>
tools/patman/main.py

index 4e0a3533e9fcd07e8e1991a9c7244c6e0ee8434f..04e37a5931394d18691eb451512a3bbba9134196 100755 (executable)
@@ -9,6 +9,7 @@
 from argparse import ArgumentParser
 import os
 import re
+import shutil
 import sys
 import traceback
 import unittest
@@ -170,6 +171,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])),