From: Nicolas Boichat Date: Wed, 17 Feb 2021 10:41:43 +0000 (+0800) Subject: patman: Use less for help file, if available X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=b1b6efc343a5c7b64bdbc0493a16b5e36fb846fb;p=u-boot.git 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 Reviewed-by: Simon Glass --- 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 @@ -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])),