Skip to content

Commit 5cc0fee

Browse files
{Core} Fix cached help returning in tab completion scenarios. (#32835)
1 parent ed336f3 commit 5cc0fee

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/azure-cli-core/azure/cli/core/commands/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def execute(self, args):
518518
command_preserve_casing = roughly_parse_command_with_casing(args)
519519
args = _pre_command_table_create(self.cli_ctx, args)
520520

521-
if self._should_use_command_index() and self._is_top_level_help_request(args):
521+
if self._should_show_cached_help(args):
522522
result = self._try_show_cached_help(command_preserve_casing, args)
523523
if result:
524524
return result
@@ -735,6 +735,11 @@ def _should_use_command_index(self):
735735
"""Check if command index optimization is enabled."""
736736
return self.cli_ctx.config.getboolean('core', 'use_command_index', fallback=True)
737737

738+
def _should_show_cached_help(self, args):
739+
return (self._should_use_command_index() and
740+
self._is_top_level_help_request(args) and
741+
not self.cli_ctx.data.get('completer_active'))
742+
738743
def _try_show_cached_help(self, command_preserve_casing, args):
739744
"""Try to show cached help for top-level help request.
740745

0 commit comments

Comments
 (0)