From a59fb9b91ddfb77112d8d5d1767ff9e5a729ffd1 Mon Sep 17 00:00:00 2001 From: Willie Xu Date: Mon, 23 Apr 2018 10:24:56 -0700 Subject: [PATCH] Fixed broken interactive completers with positional arguments (#6174) --- src/command_modules/azure-cli-interactive/HISTORY.rst | 4 ++++ .../command_modules/interactive/azclishell/_dump_commands.py | 3 ++- src/command_modules/azure-cli-interactive/setup.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/command_modules/azure-cli-interactive/HISTORY.rst b/src/command_modules/azure-cli-interactive/HISTORY.rst index 1d7d8ba9dfc..4f7bda80cb0 100644 --- a/src/command_modules/azure-cli-interactive/HISTORY.rst +++ b/src/command_modules/azure-cli-interactive/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +0.3.20 +++++++ +* Allow interactive completers to function with positional arguments. + 0.3.19 ++++++ * Stops completions upon unrecognized commands. diff --git a/src/command_modules/azure-cli-interactive/azure/cli/command_modules/interactive/azclishell/_dump_commands.py b/src/command_modules/azure-cli-interactive/azure/cli/command_modules/interactive/azclishell/_dump_commands.py index c8c3aa7ebe0..bd1955fcbbe 100644 --- a/src/command_modules/azure-cli-interactive/azure/cli/command_modules/interactive/azclishell/_dump_commands.py +++ b/src/command_modules/azure-cli-interactive/azure/cli/command_modules/interactive/azclishell/_dump_commands.py @@ -103,7 +103,8 @@ def dump_command_table(self, shell_ctx=None): 'help': cmd.arguments[key].type.settings.get('help') or '' } # the key is the first alias option - parameter_metadata[cmd.arguments[key].options_list[0]] = options + if cmd.arguments[key].options_list: + parameter_metadata[cmd.arguments[key].options_list[0]] = options cmd_table_data[command_name] = { 'parameters': parameter_metadata, diff --git a/src/command_modules/azure-cli-interactive/setup.py b/src/command_modules/azure-cli-interactive/setup.py index 9b41b565e64..491fc51fe5e 100644 --- a/src/command_modules/azure-cli-interactive/setup.py +++ b/src/command_modules/azure-cli-interactive/setup.py @@ -14,7 +14,7 @@ cmdclass = {} # Version is also defined in azclishell.__init__.py. -VERSION = "0.3.19" +VERSION = "0.3.20" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [