diff --git a/src/command_modules/azure-cli-interactive/HISTORY.rst b/src/command_modules/azure-cli-interactive/HISTORY.rst index 4f7bda80cb0..0e08c591226 100644 --- a/src/command_modules/azure-cli-interactive/HISTORY.rst +++ b/src/command_modules/azure-cli-interactive/HISTORY.rst @@ -6,6 +6,7 @@ Release History 0.3.20 ++++++ * Allow interactive completers to function with positional arguments. +* More user-friendly output when users type '\' 0.3.19 ++++++ diff --git a/src/command_modules/azure-cli-interactive/azure/cli/command_modules/interactive/azclishell/app.py b/src/command_modules/azure-cli-interactive/azure/cli/command_modules/interactive/azclishell/app.py index 811d31814ce..4b423694994 100644 --- a/src/command_modules/azure-cli-interactive/azure/cli/command_modules/interactive/azclishell/app.py +++ b/src/command_modules/azure-cli-interactive/azure/cli/command_modules/interactive/azclishell/app.py @@ -501,7 +501,8 @@ def _special_cases(self, cmd, outside): elif SELECT_SYMBOL['query'] in cmd_stripped and self.last and self.last.result: continue_flag = self.handle_jmespath_query(args) telemetry.track_query_gesture() - + elif not args: + continue_flag = True elif args[0] == '--version' or args[0] == '-v': try: continue_flag = True diff --git a/src/command_modules/azure-cli-interactive/azure/cli/command_modules/interactive/azclishell/util.py b/src/command_modules/azure-cli-interactive/azure/cli/command_modules/interactive/azclishell/util.py index 3920223021c..55dd92b4dc7 100644 --- a/src/command_modules/azure-cli-interactive/azure/cli/command_modules/interactive/azclishell/util.py +++ b/src/command_modules/azure-cli-interactive/azure/cli/command_modules/interactive/azclishell/util.py @@ -8,6 +8,11 @@ import struct import platform +from knack.log import get_logger + + +logger = get_logger(__name__) + def get_window_dim(): """ gets the dimensions depending on python version and os""" @@ -55,17 +60,13 @@ def parse_quotes(cmd, quotes=True, string=True): """ parses quotes """ import shlex - if quotes: - args = shlex.split(cmd) - else: - args = cmd.split() - - if string: - str_args = [] - for arg in args: - str_args.append(str(arg)) - return str_args - return args + try: + args = shlex.split(cmd) if quotes else cmd.split() + except ValueError as exception: + logger.error(exception) + return [] + + return [str(arg) for arg in args] if string else args def get_os_clear_screen_word():