From a8f0f81bb32cff92ce1951b48d23bcebaf0389b1 Mon Sep 17 00:00:00 2001 From: songlu <442586197@qq.com> Date: Tue, 23 Nov 2021 10:16:55 +0800 Subject: [PATCH 1/3] more commands --- src/init/azext_init/_text.py | 32 ++++++++++++++++++++++++++++++++ src/init/azext_init/custom.py | 6 +++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/init/azext_init/_text.py b/src/init/azext_init/_text.py index 6ca831c7045..1e4d24863ed 100644 --- a/src/init/azext_init/_text.py +++ b/src/init/azext_init/_text.py @@ -51,3 +51,35 @@ "desc": "This is an individual walk through where you could customize a set of common configs" } ] + +MSG_MORE_COMMANDS = [ + { + "prompt": "\nCommands to try:\n", + "commands": [ + { + "name": "az config\n", + "desc": "Display your config summary.\n", + }, + { + "name": "az config list available\n", + "desc": "Show all options that you can configure.\n" + }, + { + "name": "az config set =\n", + "desc": "Set a config.\n", + }, + { + "name": "az interactive", + "desc": "Start an interactive mode designed to help you learn.\n", + }, + { + "name": "az next\n", + "desc": "Find the next set of commands.\n", + }, + { + "name": "az --help\n", + "desc": "Display help related to a command or subcommand.\n", + }, + ] + } +] \ No newline at end of file diff --git a/src/init/azext_init/custom.py b/src/init/azext_init/custom.py index 458468c8af3..496015fffb3 100644 --- a/src/init/azext_init/custom.py +++ b/src/init/azext_init/custom.py @@ -16,7 +16,7 @@ from ._text import (MSG_WELCOME, MSG_SELECT_STEP, MSG_INPUT_SELECTION, MSG_PROMPT_MANAGE_GLOBAL, MSG_NO_CONFIGURATION, MSG_CURRENT_SETTINGS, MSG_PROMPT_GLOBAL_OUTPUT, MSG_PROMPT_TELEMETRY, MSG_PROMPT_FILE_LOGGING, MSG_PROMPT_CACHE_TTL, INIT_STEP_OPTION_LIST, MSG_CUSTOM_SETTING_APPLIED, MSG_MORE_CONFIG_SETTINGS, - MSG_MORE_CONFIG_LINK, CONTENT_INDENT_BROADBAND) + MSG_MORE_CONFIG_LINK, CONTENT_INDENT_BROADBAND, MSG_MORE_COMMANDS) from ._utils import prompt_option_list, get_int_option, print_successful_styled_text @@ -170,4 +170,8 @@ def handle_interactive_mode(cmd, config_list): print_styled_text([(Style.PRIMARY, CONTENT_INDENT_BROADBAND + MSG_MORE_CONFIG_SETTINGS), (Style.HYPERLINK, MSG_MORE_CONFIG_LINK)]) + print_styled_text((Style.PRIMARY, MSG_MORE_COMMANDS[0]['prompt'])) + for msg in MSG_MORE_COMMANDS[0]['commands']: + print_styled_text([(Style.PRIMARY, CONTENT_INDENT_BROADBAND + msg['name']), + (Style.SECONDARY, CONTENT_INDENT_BROADBAND + msg['desc'])]) print() From 3abdd8ce14c7c74b7c27b66f3b22e0ace173b332 Mon Sep 17 00:00:00 2001 From: songlu <442586197@qq.com> Date: Tue, 23 Nov 2021 10:19:48 +0800 Subject: [PATCH 2/3] Update _text.py --- src/init/azext_init/_text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init/azext_init/_text.py b/src/init/azext_init/_text.py index 1e4d24863ed..ad428e9a8ea 100644 --- a/src/init/azext_init/_text.py +++ b/src/init/azext_init/_text.py @@ -82,4 +82,4 @@ }, ] } -] \ No newline at end of file +] From 0b436114d2f33203bfa20c72f78546b8a35e607f Mon Sep 17 00:00:00 2001 From: songlu <442586197@qq.com> Date: Tue, 23 Nov 2021 11:49:27 +0800 Subject: [PATCH 3/3] update --- src/init/azext_init/_text.py | 51 +++++++++++++++++------------------ src/init/azext_init/custom.py | 6 ++--- 2 files changed, 27 insertions(+), 30 deletions(-) diff --git a/src/init/azext_init/_text.py b/src/init/azext_init/_text.py index ad428e9a8ea..d574032753b 100644 --- a/src/init/azext_init/_text.py +++ b/src/init/azext_init/_text.py @@ -52,34 +52,31 @@ } ] +MSG_MROE_COMMANDS_PROMPT = "\nCommands to try:\n" + MSG_MORE_COMMANDS = [ { - "prompt": "\nCommands to try:\n", - "commands": [ - { - "name": "az config\n", - "desc": "Display your config summary.\n", - }, - { - "name": "az config list available\n", - "desc": "Show all options that you can configure.\n" - }, - { - "name": "az config set =\n", - "desc": "Set a config.\n", - }, - { - "name": "az interactive", - "desc": "Start an interactive mode designed to help you learn.\n", - }, - { - "name": "az next\n", - "desc": "Find the next set of commands.\n", - }, - { - "name": "az --help\n", - "desc": "Display help related to a command or subcommand.\n", - }, - ] + "name": "az config\n", + "desc": "Display your config summary.\n", + }, + { + "name": "az config list available\n", + "desc": "Show all options that you can configure.\n" + }, + { + "name": "az config set =\n", + "desc": "Set a config.\n", + }, + { + "name": "az interactive", + "desc": "Start an interactive mode designed to help you learn.\n", + }, + { + "name": "az next\n", + "desc": "Find the next set of commands.\n", + }, + { + "name": "az --help\n", + "desc": "Display help related to a command or subcommand.\n", } ] diff --git a/src/init/azext_init/custom.py b/src/init/azext_init/custom.py index 496015fffb3..f36bcec92f8 100644 --- a/src/init/azext_init/custom.py +++ b/src/init/azext_init/custom.py @@ -16,7 +16,7 @@ from ._text import (MSG_WELCOME, MSG_SELECT_STEP, MSG_INPUT_SELECTION, MSG_PROMPT_MANAGE_GLOBAL, MSG_NO_CONFIGURATION, MSG_CURRENT_SETTINGS, MSG_PROMPT_GLOBAL_OUTPUT, MSG_PROMPT_TELEMETRY, MSG_PROMPT_FILE_LOGGING, MSG_PROMPT_CACHE_TTL, INIT_STEP_OPTION_LIST, MSG_CUSTOM_SETTING_APPLIED, MSG_MORE_CONFIG_SETTINGS, - MSG_MORE_CONFIG_LINK, CONTENT_INDENT_BROADBAND, MSG_MORE_COMMANDS) + MSG_MORE_CONFIG_LINK, CONTENT_INDENT_BROADBAND, MSG_MROE_COMMANDS_PROMPT, MSG_MORE_COMMANDS) from ._utils import prompt_option_list, get_int_option, print_successful_styled_text @@ -170,8 +170,8 @@ def handle_interactive_mode(cmd, config_list): print_styled_text([(Style.PRIMARY, CONTENT_INDENT_BROADBAND + MSG_MORE_CONFIG_SETTINGS), (Style.HYPERLINK, MSG_MORE_CONFIG_LINK)]) - print_styled_text((Style.PRIMARY, MSG_MORE_COMMANDS[0]['prompt'])) - for msg in MSG_MORE_COMMANDS[0]['commands']: + print_styled_text((Style.PRIMARY, CONTENT_INDENT_BROADBAND + MSG_MROE_COMMANDS_PROMPT)) + for msg in MSG_MORE_COMMANDS: print_styled_text([(Style.PRIMARY, CONTENT_INDENT_BROADBAND + msg['name']), (Style.SECONDARY, CONTENT_INDENT_BROADBAND + msg['desc'])]) print()