continuing refactor
This commit is contained in:
@@ -506,17 +506,17 @@ class CmdletIntrospection:
|
||||
if normalized_arg == "plugin":
|
||||
canonical_cmd = (cmd_name or "").replace("_", "-").lower()
|
||||
try:
|
||||
from ProviderCore.registry import list_plugin_names_with_capability
|
||||
from ProviderCore.registry import list_configured_plugin_names_with_capability
|
||||
except Exception:
|
||||
list_plugin_names_with_capability = None # type: ignore
|
||||
list_configured_plugin_names_with_capability = None # type: ignore
|
||||
|
||||
plugin_choices: List[str] = []
|
||||
|
||||
if canonical_cmd in {"add-file"} and list_plugin_names_with_capability is not None:
|
||||
return list_plugin_names_with_capability("upload") or []
|
||||
if canonical_cmd in {"add-file"} and list_configured_plugin_names_with_capability is not None:
|
||||
return list_configured_plugin_names_with_capability("upload", config) or []
|
||||
|
||||
if list_plugin_names_with_capability is not None:
|
||||
plugin_choices = list_plugin_names_with_capability("search") or []
|
||||
if list_configured_plugin_names_with_capability is not None:
|
||||
plugin_choices = list_configured_plugin_names_with_capability("search", config) or []
|
||||
|
||||
if plugin_choices:
|
||||
return plugin_choices
|
||||
|
||||
Reference in New Issue
Block a user