This commit is contained in:
2026-01-05 07:51:19 -08:00
parent 8545367e28
commit 1f765cffda
32 changed files with 3447 additions and 3250 deletions

27
CLI.py
View File

@@ -845,21 +845,8 @@ class CmdletIntrospection:
providers.keys()
)
try:
from Provider.metadata_provider import list_metadata_providers
meta_providers = list_metadata_providers(config) or {}
meta_available = [n for n, ready in meta_providers.items() if ready]
meta_choices = (
sorted(meta_available)
if meta_available else sorted(meta_providers.keys())
)
except Exception:
meta_choices = []
merged = sorted(set(provider_choices + meta_choices))
if merged:
return merged
if provider_choices:
return provider_choices
if normalized_arg == "scrape":
try:
@@ -990,7 +977,15 @@ class CmdletCompleter(Completer):
config=config
)
if choices:
for choice in choices:
choice_list = choices
normalized_prev = prev_token.lstrip("-").strip().lower()
if normalized_prev == "provider" and current_token:
current_lower = current_token.lower()
filtered = [c for c in choices if current_lower in c.lower()]
if filtered:
choice_list = filtered
for choice in choice_list:
yield Completion(choice, start_position=-len(current_token))
# Example: if the user has typed `download-file -url ...`, then `url`
# is considered used and should not be suggested again (even as `--url`).