@@ -459,7 +459,6 @@ def _get_extension_suppressions(mod_loaders):
459459
460460 if use_command_index :
461461 command_index = CommandIndex (self .cli_ctx )
462- lookup_args = args
463462 index_result = command_index .get (args )
464463 if index_result :
465464 index_modules , index_extensions = index_result
@@ -471,7 +470,7 @@ def _get_extension_suppressions(mod_loaders):
471470
472471 # Always load modules and extensions, because some of them (like those in
473472 # ALWAYS_LOADED_EXTENSIONS) don't expose a command, but hooks into handlers in CLI core
474- _update_command_table_from_modules (lookup_args , index_modules )
473+ _update_command_table_from_modules (args , index_modules )
475474
476475 # The index won't contain suppressed extensions
477476 _update_command_table_from_extensions ([], index_extensions )
@@ -487,7 +486,7 @@ def _get_extension_suppressions(mod_loaders):
487486 logger .debug ("Loaded %d groups, %d commands." , len (self .command_group_table ), len (self .command_table ))
488487 from azure .cli .core .util import roughly_parse_command
489488 # The index may be outdated. Make sure the command appears in the loaded command table
490- raw_cmd = roughly_parse_command (lookup_args )
489+ raw_cmd = roughly_parse_command (args )
491490 for cmd in self .command_table :
492491 if raw_cmd .startswith (cmd ):
493492 # For commands with positional arguments, the raw command won't match the one in the
@@ -526,9 +525,9 @@ def _get_extension_suppressions(mod_loaders):
526525 logger .debug ("Could not find a match in the command or command group table for '%s'. "
527526 "The index may be outdated." , raw_cmd )
528527
529- if command_index .cloud_profile == 'latest' and lookup_args and \
528+ if command_index .cloud_profile == 'latest' and args and \
530529 not self .cli_ctx .data ['completer_active' ]:
531- top_command = lookup_args [0 ]
530+ top_command = args [0 ]
532531 packaged_core_index = command_index ._get_packaged_command_index (ignore_extensions = True ) or {}
533532 if top_command != 'help' and top_command not in packaged_core_index :
534533 logger .debug ("Top-level command '%s' is not in packaged core index. "
@@ -1047,7 +1046,7 @@ def get(self, args):
10471046 self .invalidate ()
10481047 return None
10491048
1050- return self ._lookup_command_in_index (index , normalized_args )
1049+ return self ._lookup_command_in_index (index , args )
10511050
10521051 def _lookup_command_in_index (self , index , args , force_load_all_extensions = False ):
10531052 """Lookup command modules/extensions from a resolved index mapping."""
0 commit comments