Skip to content

Commit

Permalink
Hide verb block from help if there are no verbs (#654)
Browse files Browse the repository at this point in the history
Rather than show an empty verb block when there are no verbs, just hide
the block from the help text entirely.

Follow-up to 6cf24ea
  • Loading branch information
cottsay authored Jul 25, 2024
1 parent aa80ae5 commit 2b2468b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion colcon_core/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2b2468b

Please sign in to comment.