about summary refs log tree commit diff
path: root/Completion/Core/_description
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-12-01 15:29:41 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-12-01 15:29:41 +0000
commitf844c87a4d676bcc8ad7ac24b5132d7aa5ccfeca (patch)
treec2a3b06a34243abe3826eead259bb08900f011f1 /Completion/Core/_description
parent26cf7b8d50f1b7d9d0b9115018ef4dc8624b5030 (diff)
downloadzsh-f844c87a4d676bcc8ad7ac24b5132d7aa5ccfeca.tar.gz
zsh-f844c87a4d676bcc8ad7ac24b5132d7aa5ccfeca.tar.xz
zsh-f844c87a4d676bcc8ad7ac24b5132d7aa5ccfeca.zip
zsh-workers/8840
Diffstat (limited to 'Completion/Core/_description')
-rw-r--r--Completion/Core/_description24
1 files changed, 15 insertions, 9 deletions
diff --git a/Completion/Core/_description b/Completion/Core/_description
index 8cd9cc2fb..54518e49f 100644
--- a/Completion/Core/_description
+++ b/Completion/Core/_description
@@ -1,27 +1,33 @@
 #autoload
 
-local gropt=-J format
+local gropt format gname
 
-if [[ "$1" = -[VJ]* ]]; then
-  gropt="$1"
+gropt=(-J)
+
+if [[ "$1" = -[VJ] ]]; then
+  gropt=("$1")
+  shift
+elif [[ "$1" = -[VJ] ]]; then
+  gropt=("-${1[3,-1]}" "${1[1,2]}")
   shift
 fi
 
-_lastdescr=( "$_lastdescr[@]" "$2" )
+_lastdescr=( "$_lastdescr[@]" "$3" )
 
 _style -s descriptions format format
+_style -s "$1" group-name gname && [[ -z "$gname" ]] && gname="$1"
 
-if _style matches group; then
+if [[ -n "$gname" ]]; then
   if [[ -n "$format" ]]; then
-    eval "$1=($gropt ${(q)2} -X ${(q)format//\\%d/$2})"
+    eval "$2=($gropt ${(q)gname} -X ${(q)format//\\%d/$3})"
   else
-    eval "$1=($gropt ${(q)2})"
+    eval "$2=($gropt ${(q)gname})"
   fi
 else
   if [[ -n "$format" ]]; then
-    eval "$1=(-X ${(q)format//\\%d/$2})"
+    eval "$2=(-J -default- -X ${(q)format//\\%d/$3})"
   else
-    eval "$1=()"
+    eval "$2=(-J -default-)"
   fi
 fi