Skip to content

Commit 8d47ddb

Browse files
dbiebercopybara-github
authored andcommitted
Show a separator as the continuation if no args are needed by a callable.
PiperOrigin-RevId: 260035298 Change-Id: Ia5f54a1b78b45e11b00ecf2a2444724205811b96
1 parent 88999fd commit 8d47ddb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

fire/helptext.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,13 @@ def _SynopsisSection(component, actions_grouped_by_kind, spec, metadata,
121121
if possible_actions:
122122
continuations.append(_GetPossibleActionsString(possible_actions))
123123
if callable(component):
124-
continuations.append(_GetArgsAndFlagsString(spec, metadata))
124+
callable_continuation = _GetArgsAndFlagsString(spec, metadata)
125+
if callable_continuation:
126+
continuations.append(callable_continuation)
127+
elif trace:
128+
# This continuation might be blank if no args are needed.
129+
# In this case, show a separator.
130+
continuations.append(trace.separator)
125131
continuation = ' | '.join(continuations)
126132

127133
synopsis_template = '{current_command} {continuation}'

0 commit comments

Comments
 (0)