df
This commit is contained in:
27
CLI.py
27
CLI.py
@@ -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`).
|
||||
|
||||
Reference in New Issue
Block a user