U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Barker <paul.barker@sancloud.com>
To: Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>,
	u-boot@lists.denx.de
Cc: Paul Barker <paul.barker@sancloud.com>
Subject: [PATCH v4 0/2] Refactor and improve full help output from tools
Date: Wed,  8 Sep 2021 12:38:00 +0100	[thread overview]
Message-ID: <20210908113802.5252-1-paul.barker@sancloud.com> (raw)

Changes from v3:
  * I found some more Python madness:

        >>> bool([])
        False
        >>> bool([None])
        True

    So we need to ensure that if `shlex.which(less)` returns None we don't set
    pager to `[None]` else we won't be able to fall back to using more as the
    pager.

    Apologies for the noise in having to send v4 so quickly!

Changes from v2:
  * Handle the case where `PAGER` is unset. For some absolutely crazy reason
    `shlex.split(None)` reads the string to split from stdin so we need to
    ensure that `os.getenv()` returns an empty string instead of None if `PAGER`
    is unset.

Changes from v1:
  * Collected the full help printing code from patman, buildman & binman into a
    single function so that when support for PAGER containing arguments is added
    it applies to all the relevant tools.


Paul Barker (2):
  tools: Refactor full help printing
  tools: Handle PAGER containing arguments

 tools/binman/control.py   |  9 +++------
 tools/buildman/control.py | 10 ++++------
 tools/patman/main.py      | 12 ++++--------
 tools/patman/tools.py     | 15 +++++++++++++++
 4 files changed, 26 insertions(+), 20 deletions(-)

-- 
2.33.0


             reply	other threads:[~2021-09-08 11:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-08 11:38 Paul Barker [this message]
2021-09-08 11:38 ` [PATCH v4 1/2] tools: Refactor full help printing Paul Barker
2021-09-25  0:37   ` Tom Rini
2021-09-08 11:38 ` [PATCH v4 2/2] tools: Handle PAGER containing arguments Paul Barker
2021-09-25  0:37   ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210908113802.5252-1-paul.barker@sancloud.com \
    --to=paul.barker@sancloud.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox