patman: Handle PAGER containing arguments
PATCH 1/1 patman: Handle PAGER containing arguments
When printing full help output from patman, we should be able to handle a PAGER variable which includes arguments, e.g. PAGER='less -F'.
---
tools/patman/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
tools/patman/main.py +5 -4
@@ -9,6 +9,7 @@ from argparse import ArgumentParser import os import re +import shlex import shutil import sys import traceback
@@ -170,14 +171,14 @@ elif args.cmd == 'send': fd.close() elif args.full_help: - pager = os.getenv('PAGER') + pager = shlex.split(os.getenv('PAGER')) if not pager: - pager = shutil.which('less') + pager = [shutil.which('less')] if not pager: - pager = 'more' + pager = ['more'] fname = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), 'README') - command.Run(pager, fname) + command.Run(*pager, fname) else: # If we are not processing tags, no need to warning about bad ones
Signature · 1 line
2.26.2
Hi Paul,
Quoted 10 lines · Paul Barker
When printing full help output from patman, we should be able to handle a PAGER variable which includes arguments, e.g. PAGER='less -F'.
Signed-off-by Paul Barker <[email protected]>---
tools/patman/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
Can you please add a function to print full help to test_util.py instead? Then we can use it in the other tools too.
Regards,
Simon
Quoted 12 lines · On Sat, 26 Jun 2021 12:31:41 -0600 Simon Glass <[email protected]> wrote:
Hi Paul,
Quoted 8 lines · Paul Barker
When printing full help output from patman, we should be able to handle a PAGER variable which includes arguments, e.g. PAGER='less -F'.
Signed-off-by Paul Barker <[email protected]>---
Quoted 6 lines
Quoted 3 lines
tools/patman/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)Can you please add a function to print full help to
test_util.pyinstead? Then we can use it in the other tools too.
Thanks for the feedback, I'll take a look at this next week and send an updated patch.
Signature · 3 lines
Paul Barker Principal Software Engineer SanCloud Ltd
Quoted 14 lines · On Sat, 26 Jun 2021 12:31:41 -0600 Simon Glass <[email protected]> wrote:
Hi Paul,
Quoted 10 lines · Paul Barker
When printing full help output from patman, we should be able to handle a PAGER variable which includes arguments, e.g. PAGER='less -F'.
Signed-off-by Paul Barker <[email protected]>---
tools/patman/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
Quoted 5 lines
Can you please add a function to print full help to
test_util.pyinstead? Then we can use it in the other tools too.Regards,
Simon
Hi Simon,
I had to delay work on this due to illness, it's still on my list though.
Thanks,
Signature · 3 lines
Paul Barker Principal Software Engineer SanCloud Ltd