zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: use of _arguments for set
@ 2001-05-21 12:25 Oliver Kiddle
  2001-05-21 16:11 ` Oliver Kiddle
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Kiddle @ 2001-05-21 12:25 UTC (permalink / raw)
  To: zsh-workers

_set still hadn't been updated to use _arguments.

This showed up one bug in the recent _arguments changes:

set -A<tab> will complete only arrays but
set +A<tab> also offers other + options as if -W had been specified to
_arguments.

The completion of option letters should probably go in an
_option_letters so that it can be used for setopt and unsetopt. Is there
any way to list these options in a separate group from the normal
options?

Oliver

Index: Completion/Zsh/Command/_set
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Command/_set,v
retrieving revision 1.1
diff -u -r1.1 _set
--- Completion/Zsh/Command/_set 2001/04/02 11:30:19     1.1
+++ Completion/Zsh/Command/_set 2001/05/21 12:13:22
@@ -1,9 +1,25 @@
 #compdef set
 
-local prev="$words[CURRENT-1]"
-
-if [[ "$prev" = [-+]o ]]; then
-  _options
-elif [[ "$prev" = -A ]]; then
-  _arrays
-fi
+noglob _arguments -s -S \
+  - list '+[list names of parameters]' - others \
+  '-o+[set specified option]:option:_options' \
+  '+o+[unset specified option]:option:_options' \
+  '-s[sort arguments in descending order]' \
+  '+s[sort arguments in ascending order]' \
+  '-A+[define array with specified name]:array:_arrays' \
+  '+A+[replace initial elements in specified array]:array:_arrays' \
+  {-,+}0[correct] {-,+}1[printexitvalue] {-,+}2[no-badpattern] \
+  {-,+}3[no-nomatch] {-,+}4[globdots] {-,+}5[notify] {-,+}6[bgnice] \
+  {-,+}7[ignoreeof] {-,+}8[markdirs] {-,+}9[autolist] {-,+}B[no-beep] \
+  {-,+}C[no-clobber] {-,+}D[pushdtohome] {-,+}E[pushdsilent] {-,+}F[no-glob] \
+  {-,+}G[nullglob] {-,+}H[rmstarsilent] {-,+}I[ignorebraces] {-,+}J[autocd] \
+  {-,+}K[no-banghist] {-,+}L[sunkeyboardhack] {-,+}M[singlelinezle] \
+  {-,+}N[autopushd] {-,+}O[correctall] {-,+}P[rcexpandparam] {-,+}Q[pathdirs] \
+  {-,+}R[longlistjobs] {-,+}S[recexact] {-,+}T[cdablevars] \
+  {-,+}U[mailwarning] {-,+}V[no-promptcr] {-,+}W[autoresume] \
+  {-,+}X[listtypes] {-,+}Y[menucomplete] {-,+}Z[zle] {-,+}a[allexport] \
+  {-,+}d[no-globalrcs] {-,+}e[errexit] {-,+}f[no-rcs] {-,+}g[histignorespace] \
+  {-,+}h[histignoredups] {-,+}i[interactive] {-,+}k[interactivecomments] \
+  {-,+}l[login] {-,+}m[monitor] {-,+}n[no-exec] {-,+}p[privileged] \
+  {-,+}r[restricted] {-,+}t[singlecommand] {-,+}u[no-unset] {-,+}v[verbose] \
+  {-,+}w[chaselinks] {-,+}x[xtrace] {-,+}y[shwordsplit]


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: use of _arguments for set
  2001-05-21 12:25 PATCH: use of _arguments for set Oliver Kiddle
@ 2001-05-21 16:11 ` Oliver Kiddle
  0 siblings, 0 replies; 2+ messages in thread
From: Oliver Kiddle @ 2001-05-21 16:11 UTC (permalink / raw)
  To: zsh-workers

Oliver Kiddle wrote:

> This showed up one bug in the recent _arguments changes:
> 
> set -A<tab> will complete only arrays but
> set +A<tab> also offers other + options as if -W had been specified to
> _arguments.

I had a closer look and this seems to be the fix:

Index: Completion/Base/Core/_tags
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Core/_tags,v
retrieving revision 1.1
diff -u -r1.1 _tags
--- Completion/Base/Core/_tags  2001/04/02 11:04:49     1.1
+++ Completion/Base/Core/_tags  2001/05/21 16:06:53
@@ -41,7 +41,7 @@
     "$_sort_tags" "$@"
   else
     zstyle -a ":completion:${curcontext}:" tag-order order ||
-        order=('(|*-)argument-* (|*-)option-* values' options)
+        order=('(|*-)argument-* (|*-)option[-+]* values' options)
 
     for tag in $order; do
       case $tag in


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-05-21 16:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-21 12:25 PATCH: use of _arguments for set Oliver Kiddle
2001-05-21 16:11 ` Oliver Kiddle

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).