U-boot Archive mirror
 help / color / mirror / Atom feed
* [PATCH] patman: Handle PAGER containing arguments
@ 2021-06-15 10:25 Paul Barker
  2021-06-26 18:31 ` Simon Glass
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Barker @ 2021-06-15 10:25 UTC (permalink / raw
  To: Simon Glass, u-boot; +Cc: 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 <paul.barker@sancloud.com>
---

 tools/patman/main.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/patman/main.py b/tools/patman/main.py
index 04e37a5931..4d6f195b7c 100755
--- a/tools/patman/main.py
+++ b/tools/patman/main.py
@@ -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
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] patman: Handle PAGER containing arguments
  2021-06-15 10:25 [PATCH] patman: Handle PAGER containing arguments Paul Barker
@ 2021-06-26 18:31 ` Simon Glass
  2021-06-29 13:09   ` Paul Barker
  2021-07-20  8:51   ` Paul Barker
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Glass @ 2021-06-26 18:31 UTC (permalink / raw
  To: Paul Barker; +Cc: U-Boot Mailing List

Hi Paul,

On Tue, 15 Jun 2021 at 04:26, Paul Barker <paul.barker@sancloud.com> wrote:
>
> 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 <paul.barker@sancloud.com>
> ---
>
>  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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] patman: Handle PAGER containing arguments
  2021-06-26 18:31 ` Simon Glass
@ 2021-06-29 13:09   ` Paul Barker
  2021-07-20  8:51   ` Paul Barker
  1 sibling, 0 replies; 4+ messages in thread
From: Paul Barker @ 2021-06-29 13:09 UTC (permalink / raw
  To: Simon Glass; +Cc: U-Boot Mailing List

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

On Sat, 26 Jun 2021 12:31:41 -0600
Simon Glass <sjg@chromium.org> wrote:

> Hi Paul,
> 
> On Tue, 15 Jun 2021 at 04:26, Paul Barker <paul.barker@sancloud.com>
> wrote:
> >
> > 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 <paul.barker@sancloud.com>
> > ---
> >
> >  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.

Thanks for the feedback, I'll take a look at this next week and send an
updated patch.

-- 
Paul Barker
Principal Software Engineer
SanCloud Ltd

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] patman: Handle PAGER containing arguments
  2021-06-26 18:31 ` Simon Glass
  2021-06-29 13:09   ` Paul Barker
@ 2021-07-20  8:51   ` Paul Barker
  1 sibling, 0 replies; 4+ messages in thread
From: Paul Barker @ 2021-07-20  8:51 UTC (permalink / raw
  To: Simon Glass; +Cc: U-Boot Mailing List

[-- Attachment #1: Type: text/plain, Size: 821 bytes --]

On Sat, 26 Jun 2021 12:31:41 -0600
Simon Glass <sjg@chromium.org> wrote:

> Hi Paul,
> 
> On Tue, 15 Jun 2021 at 04:26, Paul Barker <paul.barker@sancloud.com> wrote:
> >
> > 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 <paul.barker@sancloud.com>
> > ---
> >
> >  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

Hi Simon,

I had to delay work on this due to illness, it's still on my list
though.

Thanks,

-- 
Paul Barker
Principal Software Engineer
SanCloud Ltd

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-20  8:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-15 10:25 [PATCH] patman: Handle PAGER containing arguments Paul Barker
2021-06-26 18:31 ` Simon Glass
2021-06-29 13:09   ` Paul Barker
2021-07-20  8:51   ` Paul Barker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).