diff --git a/src/azure-cli-core/azure/cli/core/__init__.py b/src/azure-cli-core/azure/cli/core/__init__.py index 91df1df063d..f4253ffa969 100644 --- a/src/azure-cli-core/azure/cli/core/__init__.py +++ b/src/azure-cli-core/azure/cli/core/__init__.py @@ -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) @@ -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 diff --git a/src/azure-cli-core/azure/cli/core/_help.py b/src/azure-cli-core/azure/cli/core/_help.py index 10d3c8bb978..44053e950d9 100644 --- a/src/azure-cli-core/azure/cli/core/_help.py +++ b/src/azure-cli-core/azure/cli/core/_help.py @@ -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, @@ -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: + 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 diff --git a/src/azure-cli-core/azure/cli/core/commands/constants.py b/src/azure-cli-core/azure/cli/core/commands/constants.py index 16451f7c7cd..232ecd4dec5 100644 --- a/src/azure-cli-core/azure/cli/core/commands/constants.py +++ b/src/azure-cli-core/azure/cli/core/commands/constants.py @@ -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