zsh-workers
 help / color / mirror / code / Atom feed
From: Tanaka Akira <akr@jaist.ac.jp>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: -d for everone (and misc.)
Date: 17 Sep 1999 09:55:37 +0900	[thread overview]
Message-ID: <rsqemfy73w6.fsf@crane.jaist.ac.jp> (raw)
In-Reply-To: Sven Wischnowsky's message of "Wed, 15 Sep 1999 15:54:51 +0200 (MET DST)"

In article <199909151354.PAA32362@beta.informatik.hu-berlin.de>,
  Sven Wischnowsky <wischnow@informatik.hu-berlin.de> writes:

> I forgot to say `... except for _cvs and _apt'.

Following patch modifies _apt and _cvs to use -d instead of -y.

Also, it modifies _describe to make it work without option for
compadd.

Index: Completion/Base/_describe
===================================================================
RCS file: /projects/zsh/zsh/Completion/Base/_describe,v
retrieving revision 1.1.1.1
diff -u -F^( -r1.1.1.1 _describe
--- _describe	1999/09/15 14:35:20	1.1.1.1
+++ _describe	1999/09/17 00:50:41
@@ -58,7 +58,7 @@
   (( nsets++ ))
   descr="$1"
   [[ -n "$showd" ]] && adescr=( "$adescr[@]" "${(@PM)^descr:#*:?*},$nsets" )
-  if [[ "$2" = -* ]]; then
+  if [[ $# = 1 || "$2" = -* ]]; then
     match=''
     shift
   else
Index: Completion/Debian/_apt
===================================================================
RCS file: /projects/zsh/zsh/Completion/Debian/_apt,v
retrieving revision 1.1.1.5
diff -u -F^( -r1.1.1.5 _apt
--- _apt	1999/09/14 00:20:36	1.1.1.5
+++ _apt	1999/09/17 00:50:42
@@ -54,7 +54,7 @@
   case \$current_option in
   ${comp_hasarg}esac"
 
-  local short_seq false true bool __bool_ intlevel word word1 nul
+  local short_seq false true bool bool_prefix intlevel word word1 nul
   local comp_bool comp_intlevel comp_configfile comp_arbitem comp_long comp_opt
   local regex_short regex_long regex_all
 
@@ -66,7 +66,7 @@
   true=(yes true with on enable)
   bool=($false $true)
 
-  __bool_=(--${^bool}-)
+  bool_prefix=(--${^bool}-)
 
   intlevel='[0-9]##'
 
@@ -82,36 +82,28 @@
   comp_short=\
 'if [[ $PREFIX = -'"$short_seq"' ]]; then
   _apt_consume_short ${PREFIX[2,-1]}
-  tmp1=(${${(M)${(s:,:)${(kj:,:)options[(R)*~0]}}:#-?}#-})
-  if [[ $PREFIX = - ]]; then
-    compadd "$expl_opt[@]" - -${^tmp1}
-  else
-    tmp2=(-${^tmp1})
-    compadd "$expl_opt[@]" -y "($tmp2)" - ${PREFIX}${^tmp1}
-  fi
+  tmp1=(${(M)${(s:,:)${(kj:,:)options[(R)*~0]}}:#-?})
+  tmp2=(${PREFIX}${^tmp1#-})
+  _describe -o option tmp1 tmp2
 elif [[ -z "$PREFIX" ]]; then
-  compadd "$expl_opt[@]" - ${(M)${(s:,:)${(kj:,:)options[(R)*~0]}}:#-?}
+  tmp1=(${(M)${(s:,:)${(kj:,:)options[(R)*~0]}}:#-?})
+  _describe -o option tmp1
 fi'
 
   comp_long=\
 'tmp1="${(j:|:)${(@)${(@M)${(@s:,:)${(@kj:,:)options[(R)*~0]}}:#--*}#--}}"
 tmp2=(--${(M)^long_bool:#$~tmp1} --${(M)^long_intlevel:#$~tmp1})
-compadd "$expl_opt[@]" - $tmp2
-tmp2=(--${(M)^long_hasarg:#$~tmp1} --${(M)^long_configfile:#$~tmp1} --${(M)^long_arbitem:#$~tmp1})
-compadd "$expl_opt[@]" -S= - $tmp2
-compadd "$expl_opt[@]" -S "" - '"$__bool_"
+tmp3=(--${(M)^long_hasarg:#$~tmp1} --${(M)^long_configfile:#$~tmp1} --${(M)^long_arbitem:#$~tmp1})
+_describe -o option tmp2 -- tmp3 -S= -- bool_prefix -S ""'
 
   comp_long_prefix=\
 'tmp1="${(j:|:)${(@)${(@M)${(@s:,:)${(@kj:,:)options[(R)*~0]}}:#--*}#--}}"
 tmp2=($_ra_left${(M)^long_bool:#$~tmp1} $_ra_left${(M)^long_intlevel:#$~tmp1})
-compadd "$expl_opt[@]" - $tmp2
-tmp2=($_ra_left${(M)^long_hasarg:#$~tmp1} $_ra_left${(M)^long_configfile:#$~tmp1} $_ra_left${(M)^long_arbitem:#$~tmp1})
-compadd "$expl_opt[@]" -S= - $tmp2
+tmp3=($_ra_left${(M)^long_hasarg:#$~tmp1} $_ra_left${(M)^long_configfile:#$~tmp1} $_ra_left${(M)^long_arbitem:#$~tmp1})
 tmp1="${(j:|:)${(@)${(@M)${(@s:,:)${(@kj:,:)options[(R)*~0]}}:#-?}#-}}"
-tmp2=($_ra_left${(M)^short_bool:#$~tmp1} $_ra_left${(M)^short_intlevel:#$~tmp1})
-compadd "$expl_opt[@]" - $tmp2
-tmp2=($_ra_left${(M)^short_hasarg:#$~tmp1} $_ra_left${(M)^short_configfile:#$~tmp1} $_ra_left${(M)^short_arbitem:#$~tmp1})
-compadd "$expl_opt[@]" -S= - $tmp2'
+tmp2=("$tmp2[@]" $_ra_left${(M)^short_bool:#$~tmp1} $_ra_left${(M)^short_intlevel:#$~tmp1})
+tmp3=("$tmp3[@]" $_ra_left${(M)^short_hasarg:#$~tmp1} $_ra_left${(M)^short_configfile:#$~tmp1} $_ra_left${(M)^short_arbitem:#$~tmp1})
+_describe -o option tmp2 -- tmp3 -S='
 
   comp_opt='[[ -prefix - || -z "$compconfig[option_prefix]" || "$compconfig[option_prefix]" = *\!$words[1]* ]]'" && { $comp_short; $comp_long }"
 
@@ -321,6 +313,7 @@
 
     local short_hasarg short_bool short_intlevel short_configfile short_arbitem
     local long_hasarg long_bool long_intlevel long_configfile long_arbitem
+    local bool_prefix
     short_hasarg=($short_hasarg)
     short_bool=($short_bool)
     short_intlevel=($short_intlevel)
@@ -331,13 +324,14 @@
     long_intlevel=($long_intlevel)
     long_configfile=($long_configfile)
     long_arbitem=($long_arbitem)
+    bool_prefix=($bool_prefix)
 
     local expl_opt expl_bool expl_configfile
     _description expl_opt option
     _description expl_bool 'bool value'
     _description expl_configfile 'config file'
 
-    local current_option tmp1 tmp2
+    local current_option tmp1 tmp2 tmp3
 
     ${funcname}_sm
   }"
Index: Completion/User/_cvs
===================================================================
RCS file: /projects/zsh/zsh/Completion/User/_cvs,v
retrieving revision 1.1.1.10
diff -u -F^( -r1.1.1.10 _cvs
--- _cvs	1999/09/09 14:10:17	1.1.1.10
+++ _cvs	1999/09/17 00:50:42
@@ -227,7 +227,7 @@
 _cvs_history_x () {
   compset -P '*'
 
-  compadd "$@" -y '(
+  compadd "$@" -S '' -d '(
   F\ --\ release
   O\ --\ checkout
   E\ --\ export
-- 
Tanaka Akira


  reply	other threads:[~1999-09-17  0:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-15 13:54 Sven Wischnowsky
1999-09-17  0:55 ` Tanaka Akira [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-09-15 13:51 Sven Wischnowsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=rsqemfy73w6.fsf@crane.jaist.ac.jp \
    --to=akr@jaist.ac.jp \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).