bc0d7fa6ab15e16a5200f95f414b30e24aa9b1a6

Author
Brennan Lujan <7959971+blujan@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

feat(eza): add smart-group option (#13857)

Diff

 1diff --git a/plugins/eza/README.md b/plugins/eza/README.md
 2index bec1f85cb9382569ab0ed86c4cdf8c9f94b33f12..5c2f590e0a57fc0214ded497fe029147c3f04a0c 100644
 3--- a/plugins/eza/README.md
 4+++ b/plugins/eza/README.md
 5@@ -48,10 +48,11 @@ Default: `no`
 6 ### `show-group`
 7 
 8 ```zsh
 9-zstyle ':omz:plugins:eza' 'show-group' yes|no
10+zstyle ':omz:plugins:eza' 'show-group' yes|no|smart
11 ```
12 
13 If `yes` (default), always add `-g` flag to show the group ownership.
14+If `smart`, adds the `--smart-group` flag to only show the group if it has a different name from the owner.
15 
16 Default: `yes`
17 
18diff --git a/plugins/eza/eza.plugin.zsh b/plugins/eza/eza.plugin.zsh
19index 60ed1eb2777b27dc1155971f37d232b3b1f7adde..1ee86018d695fdf534ea1b39a2195305dfd6970d 100644
20--- a/plugins/eza/eza.plugin.zsh
21+++ b/plugins/eza/eza.plugin.zsh
22@@ -9,9 +9,15 @@ typeset -a _EZA_TAIL
23 function _configure_eza() {
24   local _val
25   # Get the head flags
26-  if zstyle -T ':omz:plugins:eza' 'show-group'; then
27-    _EZA_HEAD+=("g")
28-  fi
29+  zstyle -s ':omz:plugins:eza' 'show-group' _val
30+  case "${_val:l}" in
31+    yes)
32+      _EZA_HEAD+=("g")
33+      ;;
34+    smart)
35+      _EZA_TAIL+=("--smart-group")
36+      ;;
37+  esac
38   if zstyle -t ':omz:plugins:eza' 'header'; then
39     _EZA_HEAD+=("h")
40   fi