commit: 8addc22ed18f84e1047be4ca71084832bdb1cdd8 Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> AuthorDate: Mon Jan 16 20:55:36 2023 +0000 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> CommitDate: Mon Jan 16 20:55:36 2023 +0000 URL: https://gitweb.gentoo.org/proj/pkgcore/snakeoil.git/commit/?id=8addc22e
cli.arghparse: improve _format_args for Delayed Resolves: https://github.com/pkgcore/pkgcheck/issues/520 Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org> src/snakeoil/cli/arghparse.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/snakeoil/cli/arghparse.py b/src/snakeoil/cli/arghparse.py index 09eaed36..375ffe42 100644 --- a/src/snakeoil/cli/arghparse.py +++ b/src/snakeoil/cli/arghparse.py @@ -556,6 +556,8 @@ class CsvHelpFormatter(argparse.HelpFormatter): result = "%s[,-%s,...]" % get_metavar(2) elif isinstance(action, (CommaSeparatedElements, CommaSeparatedElementsAppend)): result = "%s[,-%s,+%s...]" % get_metavar(3) + elif isinstance(action, Delayed): + result = self._format_args(action.target, default_metavar) else: result = super()._format_args(action, default_metavar) return result