mirror of
https://github.com/instructkr/claude-code.git
synced 2026-05-28 08:26:45 +00:00
fix(#719): plugins list <filter> now applies substring filter on plugin id, matching agents/skills parity
This commit is contained in:
@@ -5999,8 +5999,10 @@ impl LiveCli {
|
||||
CliOutputFormat::Text => println!("{}", payload.message),
|
||||
CliOutputFormat::Json => {
|
||||
let action_str = action.unwrap_or("list");
|
||||
// For show/info/describe, filter to the named plugin.
|
||||
// For show/info/describe, filter to the named plugin (exact match).
|
||||
// For list with a target, treat target as a substring filter.
|
||||
let is_show_action = matches!(action_str, "show" | "info" | "describe");
|
||||
let is_list_action = action_str == "list";
|
||||
let filtered_plugins: Vec<_> = if is_show_action {
|
||||
if let Some(name) = target {
|
||||
let needle = name.to_lowercase();
|
||||
@@ -6018,6 +6020,23 @@ impl LiveCli {
|
||||
} else {
|
||||
payload.plugins.clone()
|
||||
}
|
||||
} else if is_list_action {
|
||||
if let Some(filter) = target {
|
||||
let needle = filter.to_lowercase();
|
||||
payload
|
||||
.plugins
|
||||
.iter()
|
||||
.filter(|p| {
|
||||
p.get("id")
|
||||
.and_then(|v| v.as_str())
|
||||
.map(|id| id.to_lowercase().contains(&needle))
|
||||
.unwrap_or(false)
|
||||
})
|
||||
.cloned()
|
||||
.collect()
|
||||
} else {
|
||||
payload.plugins.clone()
|
||||
}
|
||||
} else {
|
||||
payload.plugins.clone()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user