Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 5 additions & 4 deletions src/azure-cli-core/azure/cli/core/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,11 @@ def strip_command(command):

examples = []
for example in help_file.examples:
examples.append({
'command': strip_command(example.command),
'description': example.name
})
if example.command and example.name:
examples.append({
'command': strip_command(example.command),
'description': example.name
})

return examples

Expand Down
7 changes: 5 additions & 2 deletions src/azure-cli-core/azure/cli/core/command_recommender.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def _set_aladdin_recommendations(self): # pylint: disable=too-many-locals
context['subscriptionId'] = subscription_id

parameters = self._normalize_parameters(self.parameters)
parameters = [item for item in parameters if item not in ['--debug', '--verbose', '--only-show-errors']]
parameters = [item for item in set(parameters) if item not in ['--debug', '--verbose', '--only-show-errors']]
query = {
"command": self.command,
"parameters": ','.join(parameters)
Expand Down Expand Up @@ -294,7 +294,10 @@ def replace_param_values(command): # pylint: disable=unused-variable

# generate decorated commands shown to users
decorated_command = highlight_command(raw_command)
decorated_description = [(Style.SECONDARY, recommendation['description'] + '\n')]
decorated_description = [(
Style.SECONDARY,
recommendation.get('description', 'No description is found.') + '\n'
)]
decorated_recommendations.append((decorated_command, decorated_description))

# add reference link as a recommendation
Expand Down