dfslkjelf
This commit is contained in:
25
CLI.py
25
CLI.py
@@ -549,6 +549,20 @@ def _get_cmdlet_args(cmd_name: str) -> List[str]:
|
||||
return []
|
||||
|
||||
|
||||
def get_store_choices() -> List[str]:
|
||||
"""Return configured store backend names.
|
||||
|
||||
This is the same list used for REPL/Typer autocomplete for `-store`.
|
||||
"""
|
||||
try:
|
||||
from Store import Store
|
||||
storage = Store(_load_cli_config(), suppress_debug=True)
|
||||
backends = storage.list_backends()
|
||||
return list(backends or [])
|
||||
except Exception:
|
||||
return []
|
||||
|
||||
|
||||
def _get_arg_choices(cmd_name: str, arg_name: str) -> List[str]:
|
||||
"""Get list of valid choices for a specific cmdlet argument."""
|
||||
try:
|
||||
@@ -558,14 +572,9 @@ def _get_arg_choices(cmd_name: str, arg_name: str) -> List[str]:
|
||||
# Dynamic storage backends: use current config to enumerate available storages
|
||||
# Support both "storage" and "store" argument names
|
||||
if normalized_arg in ("storage", "store"):
|
||||
try:
|
||||
from Store import Store
|
||||
storage = Store(_load_cli_config(), suppress_debug=True)
|
||||
backends = storage.list_backends()
|
||||
if backends:
|
||||
return backends
|
||||
except Exception:
|
||||
pass
|
||||
backends = get_store_choices()
|
||||
if backends:
|
||||
return backends
|
||||
|
||||
# Dynamic search providers
|
||||
if normalized_arg == "provider":
|
||||
|
||||
Reference in New Issue
Block a user