[PATCH v4 0/2] Refactor and improve full help output from tools

Paul Barker paul.barker at sancloud.com
Wed Sep 8 13:38:00 CEST 2021


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



More information about the U-Boot mailing list