about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Completion/Base/Core/_message20
1 files changed, 20 insertions, 0 deletions
diff --git a/Completion/Base/Core/_message b/Completion/Base/Core/_message
new file mode 100644
index 000000000..cd08d5fb0
--- /dev/null
+++ b/Completion/Base/Core/_message
@@ -0,0 +1,20 @@
+#autoload
+
+local format raw
+
+_tags messages || return 1
+
+if [[ "$1" = -r ]]; then
+  raw=yes
+  shift
+  format="$1"
+else
+  zstyle -s ":completion:${curcontext}:messages" format format ||
+      zstyle -s ":completion:${curcontext}:descriptions" format format
+fi
+
+if [[ -n "$format$raw" ]]; then
+  [[ -z "$raw" ]] && zformat -f format "$format" "d:$1" "${(@)argv[2,-1]}"
+  builtin compadd -x "$format"
+  _comp_mesg=yes
+fi