mirror of
https://xff.cz/git/u-boot/
synced 2025-09-27 13:31:16 +02:00
tools: Refactor full help printing
Collect the code for printing the full help message of patman, buildman and binman into a single function in patman.tools. Signed-off-by: Paul Barker <paul.barker@sancloud.com>
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user