Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: updated emulate completion
- X-seq: zsh-workers 34435
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Zsh Hackers' List <zsh-workers@xxxxxxx>
- Subject: PATCH: updated emulate completion
- Date: Fri, 30 Jan 2015 16:19:09 +0000
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
Seems basically to work, have I missed anything? The -A '-*' that was
there before seemed a bit pedantic and screwed up the use of -c.
pws
diff --git a/Completion/Unix/Command/_sh b/Completion/Unix/Command/_sh
index 104c757..21ebfc3 100644
--- a/Completion/Unix/Command/_sh
+++ b/Completion/Unix/Command/_sh
@@ -10,8 +10,7 @@ if [[ $service == zsh ]]; then
fi
if (( CURRENT == ${words[(i)-c]} + 1 )); then
- compset -q
- _normal
+ _cmdstring
else
local n=${words[(b:2:i)[^-]*]}
if (( n <= CURRENT )); then
diff --git a/Completion/Unix/Type/_cmdstring b/Completion/Unix/Type/_cmdstring
new file mode 100644
index 0000000..fb19fdb
--- /dev/null
+++ b/Completion/Unix/Type/_cmdstring
@@ -0,0 +1,6 @@
+#autoload
+
+# This is for a quoted argument that will be interpreted as a command.
+
+compset -q
+_normal
diff --git a/Completion/Zsh/Command/_emulate b/Completion/Zsh/Command/_emulate
index e562d68..d6fb0c3 100644
--- a/Completion/Zsh/Command/_emulate
+++ b/Completion/Zsh/Command/_emulate
@@ -1,6 +1,8 @@
#compdef emulate
-_arguments -C -s -A "-*" \
+_arguments -C -s \
'-L[set local_options and local_traps as well]' \
'-R[reset all options instead of only those needed for script portability]' \
- '::shell to emulate:(zsh sh ksh csh)'
+ '1:shell to emulate:(zsh sh ksh csh)' \
+ '2:specify optional command:(-c)' \
+ '3:command:_cmdstring'
Messages sorted by:
Reverse Date,
Date,
Thread,
Author