aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2023-01-16 22:55:36 +0200
committerArthur Zamarin <arthurzam@gentoo.org>2023-01-16 22:55:36 +0200
commit8addc22ed18f84e1047be4ca71084832bdb1cdd8 (patch)
tree26b5bc5e022e280add1c3ebd5349f467bc99199a
parentfileutils: small cleanup and modernization (diff)
downloadsnakeoil-8addc22ed18f84e1047be4ca71084832bdb1cdd8.tar.gz
snakeoil-8addc22ed18f84e1047be4ca71084832bdb1cdd8.tar.bz2
snakeoil-8addc22ed18f84e1047be4ca71084832bdb1cdd8.zip
cli.arghparse: improve _format_args for Delayed
Resolves: https://github.com/pkgcore/pkgcheck/issues/520 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r--src/snakeoil/cli/arghparse.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/snakeoil/cli/arghparse.py b/src/snakeoil/cli/arghparse.py
index 09eaed3..375ffe4 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