Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
merge master
  • Loading branch information
BurtBiel committed May 4, 2016
commit bd25ba8e3ccb9bdf320104ba9b6ce12bc97c609c
10 changes: 8 additions & 2 deletions src/azure/cli/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def print_arguments(help_file):
+ str(not p.required) + p.name):
indent = 1
required_text = required_tag if p.required else ''
p.short_summary = (p.short_summary if p.short_summary else '') + _get_choices_str(p)
if p.group_name != last_group_name:
if p.group_name:
print('')
Expand Down Expand Up @@ -224,6 +225,8 @@ def __init__(self, delimiters, parser):
self.parameters.append(HelpParameter(' '.join(sorted(action.option_strings)),
action.help,
required=action.required,
choices=action.choices,
default=action.default,
group_name=action.container.description))

help_param = next(p for p in self.parameters if p.name == '--help -h')
Expand Down Expand Up @@ -251,14 +254,17 @@ def _load_from_data(self, data):
self.parameters = loaded_params


class HelpParameter(object): #pylint: disable=too-few-public-methods
def __init__(self, param_name, description, required, group_name=False):
class HelpParameter(object): #pylint: disable=too-few-public-methods, too-many-instance-attributes
def __init__(self, param_name, description, required, choices=None, #pylint: disable=too-many-arguments
default=None, group_name=None):
self.name = param_name
self.required = required
self.type = 'string'
self.short_summary = description
self.long_summary = ''
self.value_sources = []
self.choices = choices
self.default = default
self.group_name = group_name

def update_from_data(self, data):
Expand Down
3 changes: 2 additions & 1 deletion src/azure/cli/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ def _register_builtin_arguments(global_group):
global_group.add_argument('--subscription', dest='_subscription_id', help=argparse.SUPPRESS)
global_group.add_argument('--output', '-o', dest='_output_format',
choices=['list', 'json', 'tsv'],
help='Output format of type "list", "json" or "tsv"')
default='list',
help='Output format')
# The arguments for verbosity don't get parsed by argparse but we add it here for help.
global_group.add_argument('--verbose', dest='_log_verbosity_verbose',
help='Increase logging verbosity.'
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.