in awscli/customizations/commands.py [0:0]
def doc_synopsis_option(self, arg_name, help_command, **kwargs):
if not help_command.synopsis:
doc = help_command.doc
argument = help_command.arg_table[arg_name]
if argument.synopsis:
option_str = argument.synopsis
elif argument.group_name in self._arg_groups:
if argument.group_name in self._documented_arg_groups:
# This arg is already documented so we can move on.
return
option_str = ' | '.join(
[a.cli_name for a in
self._arg_groups[argument.group_name]])
self._documented_arg_groups.append(argument.group_name)
elif argument.cli_type_name == 'boolean':
option_str = '%s' % argument.cli_name
elif argument.nargs == '+':
option_str = "%s <value> [<value>...]" % argument.cli_name
else:
option_str = '%s <value>' % argument.cli_name
if not (argument.required or argument.positional_arg):
option_str = '[%s]' % option_str
doc.writeln('%s' % option_str)
else:
# A synopsis has been provided so we don't need to write
# anything here.
pass