update refactoring and add new features

This commit is contained in:
2026-07-24 20:55:58 -07:00
parent 7f12bc7f40
commit 03fbbbcf28
69 changed files with 16332 additions and 17600 deletions
+20 -2
View File
@@ -827,9 +827,14 @@ class CmdletCompleter(Completer):
return None
raw_plugin = CmdletCompleter._flag_value(stage_tokens, "-plugin", "--plugin")
if raw_plugin:
# Strip quotes if present, then normalize to lowercase
stripped = CmdletCompleter._strip_quotes(str(raw_plugin or ""))
return stripped.strip().lower() if stripped else None
if not stripped:
return None
plugin_name = stripped.strip().lower()
if "," in plugin_name:
parts = [p.strip() for p in plugin_name.split(",") if p.strip()]
return parts[0] if parts else None
return plugin_name
return None
@staticmethod
@@ -1058,11 +1063,20 @@ class CmdletCompleter(Completer):
logical: idx for idx, logical in enumerate(file_stage_order)
}
action_logicals = {logical for logical, _ in self._FILE_STAGE_ACTION_CMDLETS}
chosen_actions: Set[str] = set()
for token in stage_tokens:
logical = str(token).lstrip("-").strip().lower()
if logical in action_logicals:
chosen_actions.add(logical)
filtered: List[Tuple[int, int, str]] = []
for index, arg in enumerate(arg_names):
logical = str(arg or "").lstrip("-").strip().lower()
if file_stage_order is not None and logical not in file_stage_rank:
continue
if chosen_actions and logical in action_logicals and logical not in chosen_actions:
continue
if logical == "open":
continue
if logical == "instance":
@@ -3085,6 +3099,10 @@ Come to love it when others take what you share, as there is no greater joy
if "|" in tokens or (tokens and tokens[0].startswith("@")):
self._pipeline_executor.execute_tokens(tokens)
else:
try:
ctx.clear_pending_pipeline_tail()
except Exception:
pass
cmd_name = tokens[0].replace("_", "-").lower()
is_help = any(
arg in {"-help",