about summary refs log tree commit diff
path: root/Completion/Core
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-08-19 11:18:10 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-08-19 11:18:10 +0000
commite0dc07932aaa69889135112172515b484736a6cd (patch)
treebde42d23f16f7accca78d88c029b34eda4b8719f /Completion/Core
parent03851842c66cce7e987df4e422337f4baa66abf4 (diff)
downloadzsh-e0dc07932aaa69889135112172515b484736a6cd.tar.gz
zsh-e0dc07932aaa69889135112172515b484736a6cd.tar.xz
zsh-e0dc07932aaa69889135112172515b484736a6cd.zip
Initial revision
Diffstat (limited to 'Completion/Core')
-rw-r--r--Completion/Core/_description22
-rw-r--r--Completion/Core/_message19
2 files changed, 41 insertions, 0 deletions
diff --git a/Completion/Core/_description b/Completion/Core/_description
new file mode 100644
index 000000000..874ba8a96
--- /dev/null
+++ b/Completion/Core/_description
@@ -0,0 +1,22 @@
+#autoload
+
+local gropt=-J
+
+if [[ "$1" = -V ]]; then
+  gropt=-V
+  shift
+fi
+
+if [[ -n "$compconfig[group_matches]" ]]; then
+  if [[ -n "$compconfig[description_format]" ]]; then
+    eval "$1=($gropt ${(q)2} -X ${(q)compconfig[description_format]//\\%d/$2})"
+  else
+    eval "$1=($gropt ${(q)2})"
+  fi
+else
+  if [[ -n "$compconfig[description_format]" ]]; then
+    eval "$1=(-X ${(q)compconfig[description_format]//\\%d/$2})"
+  else
+    eval "$1=()"
+  fi
+fi
diff --git a/Completion/Core/_message b/Completion/Core/_message
new file mode 100644
index 000000000..0837cdf2f
--- /dev/null
+++ b/Completion/Core/_message
@@ -0,0 +1,19 @@
+#autoload
+
+local format
+
+format="$compconfig[message_format]"
+[[ -z "$format" ]] && "$compconfig[description_format]"
+
+if [[ -n "$format" ]]; then
+  if [[ $compstate[nmatches] -eq 0 ]]; then
+    compstate[list]=list
+    compstate[insert]=''
+    compadd -UX "${format//\\%d/$1}" -n ''
+  else
+    compadd -X "${format//\\%d/$1}" -n ''
+  fi
+  compstate[force_list]=yes
+else
+  compadd -n ''
+fi