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: 6 additions & 3 deletions src/azure-cli-core/azure/cli/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ def get_cli_version(self):

def show_version(self):
from azure.cli.core.util import get_az_version_string
from azure.cli.core.commands.constants import SURVEY_PROMPT, SURVEY_PROMPT_COLOR
from azure.cli.core.commands.constants import (SURVEY_PROMPT, SURVEY_PROMPT_COLOR,
UX_SURVEY_PROMPT, UX_SURVEY_PROMPT_COLOR)

ver_string, updates_available = get_az_version_string()
print(ver_string)
Expand All @@ -101,8 +102,10 @@ def show_version(self):
updates_available)
else:
print('Your CLI is up-to-date.')

print('\n' + (SURVEY_PROMPT_COLOR if self.enable_color else SURVEY_PROMPT))
show_link = self.config.getboolean('output', 'show_survey_link', True)
if show_link:
print('\n' + (SURVEY_PROMPT_COLOR if self.enable_color else SURVEY_PROMPT))
print(UX_SURVEY_PROMPT_COLOR if self.enable_color else UX_SURVEY_PROMPT)

def exception_handler(self, ex): # pylint: disable=no-self-use
from azure.cli.core.util import handle_exception
Expand Down
10 changes: 7 additions & 3 deletions src/azure-cli-core/azure/cli/core/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import argparse

from azure.cli.core.commands import ExtensionCommandSource
from azure.cli.core.commands.constants import SURVEY_PROMPT, SURVEY_PROMPT_COLOR
from azure.cli.core.commands.constants import (SURVEY_PROMPT, SURVEY_PROMPT_COLOR,
UX_SURVEY_PROMPT, UX_SURVEY_PROMPT_COLOR)

from knack.help import (HelpFile as KnackHelpFile, CommandHelpFile as KnackCommandHelpFile,
GroupHelpFile as KnackGroupHelpFile, ArgumentGroupRegistry as KnackArgumentGroupRegistry,
Expand Down Expand Up @@ -172,8 +173,11 @@ def show_help(self, cli_name, nouns, parser, is_group):
else:
AzCliHelp.update_examples(help_file)
self._print_detailed_help(cli_name, help_file)

print(SURVEY_PROMPT_COLOR if self.cli_ctx.enable_color else SURVEY_PROMPT)
show_link = self.cli_ctx.config.getboolean('output', 'show_survey_link', True)
if show_link:
print(SURVEY_PROMPT_COLOR if self.cli_ctx.enable_color else SURVEY_PROMPT)
if not nouns:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only add ux link for az --help without a specific command.

print(UX_SURVEY_PROMPT_COLOR if self.cli_ctx.enable_color else UX_SURVEY_PROMPT)

def _register_help_loaders(self):
import azure.cli.core._help_loaders as help_loaders
Expand Down
4 changes: 4 additions & 0 deletions src/azure-cli-core/azure/cli/core/commands/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@
SURVEY_PROMPT = 'Please let us know how we are doing: https://aka.ms/clihats'
SURVEY_PROMPT_COLOR = Fore.YELLOW + Style.BRIGHT + 'Please let us know how we are doing: ' + Fore.BLUE + \
'https://aka.ms/clihats' + Style.RESET_ALL
UX_SURVEY_PROMPT = 'and let us know if you\'re interested in trying out our newest features: https://aka.ms/CLIUXstudy'
UX_SURVEY_PROMPT_COLOR = Fore.YELLOW + Style.BRIGHT + \
'and let us know if you\'re interested in trying out our newest features: ' \
+ Fore.BLUE + 'https://aka.ms/CLIUXstudy' + Style.RESET_ALL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://aka.ms/CLIUXstudy seems to be a survey, instead of a feature.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated