From 0b3f174ff74ffebc86d51307ed3ea4f0974e53b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikkel=20M=C3=B8rk=20Hegnh=C3=B8j?= Date: Fri, 14 Aug 2026 11:34:42 +0200 Subject: [PATCH] BREAKING: change default for plugins list to only show summary and not the full list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mikkel Mørk Hegnhøj --- src/commands/plugins.rs | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/src/commands/plugins.rs b/src/commands/plugins.rs index d5358b6486..1f6924352c 100644 --- a/src/commands/plugins.rs +++ b/src/commands/plugins.rs @@ -755,11 +755,11 @@ pub struct List { #[clap(long, group = "which")] pub installed: bool, - /// List all versions of plugins. This is the default behaviour. + /// List all versions of plugins. #[clap(long, group = "which")] pub all: bool, - /// List latest and installed versions of plugins. + /// List latest and installed versions of plugins. This is the default behaviour. #[clap(long, group = "which")] pub summary: bool, @@ -798,7 +798,7 @@ impl List { } }?; - if self.summary { + if self.should_summarise() { plugins = summarise(plugins); } @@ -851,6 +851,10 @@ impl List { fn target_environment(&self) -> OptionalValueFlag { (&self.target_environment).into() } + + fn should_summarise(&self) -> bool { + self.summary || (!self.installed && !self.all) + } } /// Search for plugins by name. @@ -1192,4 +1196,28 @@ mod test { assert!(rest_vers.contains("1.2.3")); assert!(rest_vers.contains("1.3.5")); } + + #[test] + fn list_installed_disables_summary_mode() { + let list = List::parse_from(["list", "--installed"]); + assert!(!list.should_summarise()); + } + + #[test] + fn list_default_enables_summary_mode() { + let list = List::parse_from(["list"]); + assert!(list.should_summarise()); + } + + #[test] + fn list_all_disables_summary_mode() { + let list = List::parse_from(["list", "--all"]); + assert!(!list.should_summarise()); + } + + #[test] + fn list_summary_enables_summary_mode() { + let list = List::parse_from(["list", "--summary"]); + assert!(list.should_summarise()); + } }