From 2b2468b735b806901d6c5c10192d19d202e28213 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Thu, 25 Jul 2024 15:28:14 -0500 Subject: [PATCH] Hide verb block from help if there are no verbs (#654) Rather than show an empty verb block when there are no verbs, just hide the block from the help text entirely. Follow-up to 6cf24eafdb1ab67ba59935f855157fb7b9d2b6bf --- colcon_core/command.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/colcon_core/command.py b/colcon_core/command.py index 9c94118c..1328b3b5 100644 --- a/colcon_core/command.py +++ b/colcon_core/command.py @@ -428,7 +428,9 @@ def create_subparser(parser, cmd_name, verb_extensions, *, attribute): title=f'{cmd_name} verbs', description='\n'.join(verbs) or None, dest=attribute, - help=f'call `{cmd_name} VERB -h` for specific help' if verbs else None, + help=( + f'call `{cmd_name} VERB -h` for specific help' if + verbs else argparse.SUPPRESS), ) return subparser