From: Tanaka Akira <akr@jaist.ac.jp>
To: zsh-workers@sunsite.auc.dk
Subject: Re: CVS completer (Re: PATCH: Re: Completion/User functions again)
Date: 25 Jul 1999 18:23:00 +0900 [thread overview]
Message-ID: <rsqvhb9ulqj.fsf@crane.jaist.ac.jp> (raw)
In-Reply-To: "Bart Schaefer"'s message of "Wed, 21 Jul 1999 15:54:46 +0000"
In article <990721155446.ZM6856@candle.brasslantern.com>,
"Bart Schaefer" <schaefer@candle.brasslantern.com> writes:
> Yes, but again most of the _files should be changed to something that can
> interpret CVS/Entries.
This patch do it.
Most of codes to handle CVS/* are taken from Misc/compctl-examples.
--- Completion/User/_cvs- Sat Jul 24 22:59:54 1999
+++ Completion/User/_cvs Sun Jul 25 18:13:11 1999
@@ -17,52 +17,46 @@
local showlist='compstate[list]=list; compstate[force_list]=yes'
local showhint="$showlist ; compstate[insert]=''"
-local complete_D="compadd yesterday week\\ ago month\\ ago"
+local complete_D="compadd today yesterday week\\ ago month\\ ago"
local complete_k="compadd kv kvl k o b v"
-local complete_r="compadd -UX 'Enter tag name or rev number' ''; $showhint"
+local complete_r="_cvsrevisions"
local complete_m="compadd -UX 'Enter log message' -n ''; $showhint"
-
if (( com < CURRENT )); then
case "$words[$com]" in
add|ad|new) # "+k:m:"
- _complete_opts k: "$complete_k" m: "$complete_m" || _files
+ _complete_opts k: "$complete_k" m: "$complete_m" || _cvsaddp
;;
admin|adm|rcs) # "+ib::c:a:A:e:l::u::LUn:N:m:o:s:t::IqxV:k:"
- _complete_opts i '' b:: '' c: '' a: '' A: '' e: '' l:: '' u:: '' L '' U '' n: '' N: '' m: "$complete_m" o: '' s: '' t:: '' I '' q '' x '' V: '' k: "$complete_k" || _files
+ _complete_opts i '' b:: '' c: '' a: '' A: '' e: '' l:: '' u:: '' L '' U '' n: '' N: '' m: "$complete_m" o: '' s: '' t:: '' I '' q '' x '' V: '' k: "$complete_k" || _cvstargets
;;
annotate|ann) # "+lr:D:fR"
- _complete_opts l '' r: '' D: '' f '' R '' || _files
+ _complete_opts l '' r: '' D: '' f '' R '' || _cvstargets
;;
checkout|co|get) # "+ANnk:d:flRpQqcsr:D:j:P"
- _complete_opts A '' N '' n '' k: "$complete_k" d: '' f '' l '' R '' p '' Q '' q '' c '' s '' r: "$complete_r" D: "$complete_D" j: '' P '' || compadd MODULE
+ _complete_opts A '' N '' n '' k: "$complete_k" d: '' f '' l '' R '' p '' Q '' q '' c '' s '' r: "$complete_r" D: "$complete_D" j: '' P '' || _cvsrepositories
;;
commit|ci|com) # "+nlRm:fF:r:"
- _complete_opts n '' l '' R '' m: "$complete_m" f '' F: '' r: "$complete_r" || _files
+ _complete_opts n '' l '' R '' m: "$complete_m" f '' F: '' r: "$complete_r" || _cvstargets
;;
diff|di|dif) # "+abcdefhilnpstuw0123456789BHNRC:D:F:I:L:U:V:W:k:r:"
- _complete_opts a '' b '' c '' d '' e '' f '' h '' i '' l '' n '' p '' s '' t '' u '' w '' 0 '' 1 '' 2 '' 3 '' 4 '' 5 '' 6 '' 7 '' 8 '' 9 '' B '' H '' N '' R '' C: '' D: "$complete_D" F: '' I: '' L: '' U: '' V: '' W: '' k: "$complete_k" r: "$complete_r" || _files
+ _complete_opts a '' b '' c '' d '' e '' f '' h '' i '' l '' n '' p '' s '' t '' u '' w '' 0 '' 1 '' 2 '' 3 '' 4 '' 5 '' 6 '' 7 '' 8 '' 9 '' B '' H '' N '' R '' C: '' D: "$complete_D" F: '' I: '' L: '' U: '' V: '' W: '' k: "$complete_k" r: "$complete_r" || _cvstargets
;;
edit) # "+lRa:"
- _complete_opts l '' R '' a: '' || _files
+ _complete_opts l '' R '' a: '' || _cvstargets
;;
editors) # "+lR"
- _complete_opts l '' R '' || _files
+ _complete_opts l '' R '' || _cvstargets
;;
export|exp|ex) # "+ANnk:d:flRpQqcsr:D:j:P"
- _complete_opts A '' N '' n '' k: "$complete_k" d: '' f '' l '' R '' p '' Q '' q '' c '' s '' r: "$complete_r" D: "$complete_D" j: '' P '' || compadd MODULE
+ _complete_opts A '' N '' n '' k: "$complete_k" d: '' f '' l '' R '' p '' Q '' q '' c '' s '' r: "$complete_r" D: "$complete_D" j: '' P '' || _cvsrepositories
;;
history|hi|his) # "+Tacelow?D:b:f:m:n:p:r:t:u:x:X:z:"
- _complete_opts T '' a '' c '' e '' l '' o '' w '' \? '' D: "$complete_D" b: '' f: '' m: "$complete_m" n: '' p: '' r: '' t: '' u: '' x: '' X: '' z: '' || _files
+ _complete_opts T '' a '' c '' e '' l '' o '' w '' \? '' D: "$complete_D" b: '' f: '' m: "$complete_m" n: '' p: '' r: '' t: '' u: '' x: '' X: '' z: '' || _cvstargets
;;
import|im|imp) # "+Qqdb:m:I:k:W:"
_complete_opts Q '' q '' d '' b: '' m: "$complete_m" I: '' k: "$complete_k" W: '' || case $[CURRENT-com] in
- 1) if [[ "${+CVSROOT}" == 1 && "$CVSROOT" != :* ]]; then
- compgen -X "Enter repository name" -W "$CVSROOT" -g '*~*CVSROOT(/)' -s ''
- else
- compadd -UX "Enter repository name" -n '' && eval "$showhint"
- fi
- ;;
+ 1) _cvsrepositories;;
2) compadd -UX "Enter vendor tag name" -n '' && eval "$showhint";;
3) compadd -UX "Enter release tag name" -n '' && eval "$showhint";;
*) compadd -UX "No futher arguments used" -n '' && eval "$showhint";;
@@ -75,25 +69,25 @@
_complete_opts || _files
;;
rdiff|patch|pa) # "+V:k:cuftsQqlRD:r:"
- _complete_opts V: '' k: "$complete_k" c '' u '' f '' t '' s '' Q '' q '' l '' R '' D: "$complete_D" r: "$complete_r" || _files
+ _complete_opts V: '' k: "$complete_k" c '' u '' f '' t '' s '' Q '' q '' l '' R '' D: "$complete_D" r: "$complete_r" || _cvstargets
;;
release|re|rel) # "+Qdq"
_complete_opts Q '' d '' q '' || _files -/
;;
remove|rm|delete) # "+flR"
- _complete_opts f '' l '' R '' || _files
+ _complete_opts f '' l '' R '' || _cvsremovep
;;
status|st|stat) # "+vlR"
- _complete_opts v '' l '' R '' || _files
+ _complete_opts v '' l '' R '' || _cvstargets
;;
tag|ta|freeze) # "+FQqlRcdr:D:bf"
- _complete_opts F '' Q '' q '' l '' R '' c '' d '' r: "$complete_r" D: "$complete_D" b '' f '' || _files
+ _complete_opts F '' Q '' q '' l '' R '' c '' d '' r: "$complete_r" D: "$complete_D" b '' f '' || _cvstargets
;;
unedit) # "+lR"
- _complete_opts l '' R '' || _files
+ _complete_opts l '' R '' || _cvstargets
;;
update|up|upd) # "+ApPflRQqduk:r:D:j:I:W:"
- _complete_opts A '' p '' P '' f '' l '' R '' Q '' q '' d '' u '' k: "$complete_k" r: "$complete_r" D: "$complete_D" j: '' I: '' W: '' || _files
+ _complete_opts A '' p '' P '' f '' l '' R '' Q '' q '' d '' u '' k: "$complete_k" r: "$complete_r" D: "$complete_D" j: '' I: '' W: '' || _cvstargets
;;
watch)
if (( CURRENT == com + 1 )); then
@@ -101,16 +95,16 @@
else
case "$words[com+1]" in
on|off) # "+lR"
- _complete_opts l '' R '' || _files
+ _complete_opts l '' R '' || _cvstargets
;;
add|remove) # "+lRa:"
- _complete_opts l '' R '' a: '' || _files
+ _complete_opts l '' R '' a: '' || _cvstargets
;;
esac
fi
;;
watchers) # "+lR"
- _complete_opts l '' R '' || _files
+ _complete_opts l '' R '' || _cvstargets
;;
*) _files;;
esac
--- /dev/null Sun Jul 25 17:58:12 1999
+++ Completion/User/_cvsaddp Sun Jul 25 18:13:11 1999
@@ -0,0 +1,12 @@
+#autoload
+
+local pref entries
+_cvsprefix
+_cvsentries
+setopt localoptions unset
+local all omit
+all=( ${pref}*(D) )
+omit=( $entries ${pref}${^${=cvsignore}} )
+[[ -r ~/.cvsignore ]] && omit=( $omit ${pref}${^$(<~/.cvsignore)} )
+[[ -r ${pref}.cvsignore ]] && omit=( $omit ${pref}${^$(<${pref}.cvsignore)} )
+eval 'compadd - ${all:#('${(j:|:)omit}')}'
--- /dev/null Sun Jul 25 17:58:12 1999
+++ Completion/User/_cvsentries Sun Jul 25 18:13:11 1999
@@ -0,0 +1,7 @@
+#autoload
+
+setopt localoptions nullglob unset
+if [[ -f ${pref}CVS/Entries ]]; then
+ entries=( "${pref}${(@)^${(@)${(@)${(f@)$(<${pref}CVS/Entries)}:#D*}#/}%%/*}" )
+fi
+
--- /dev/null Sun Jul 25 17:58:12 1999
+++ Completion/User/_cvsprefix Sun Jul 25 18:13:11 1999
@@ -0,0 +1,11 @@
+#autoload
+
+local f
+pref=$PREFIX
+if [[ -d $pref:h && ! -d $pref ]]; then
+ pref=$pref:h
+elif [[ $pref != */* ]]; then
+ pref=
+fi
+[[ -n "$pref" && "$pref" != */ ]] && pref=$pref/
+
--- /dev/null Sun Jul 25 17:58:12 1999
+++ Completion/User/_cvsremovep Sun Jul 25 18:13:11 1999
@@ -0,0 +1,9 @@
+#autoload
+
+local pref entries
+_cvsprefix
+_cvsentries
+setopt localoptions unset
+local omit
+omit=( ${pref}*(D) )
+eval 'compadd - ${entries:#('${(j:|:)omit}')}'
--- /dev/null Sun Jul 25 17:58:12 1999
+++ Completion/User/_cvsrepositories Sun Jul 25 18:13:11 1999
@@ -0,0 +1,12 @@
+#autoload
+
+local root=$CVSROOT
+[[ -f CVS/Root ]] && root=$(<CVS/Root)
+
+if [[ $root = :* || ! -d $root ]]; then
+ compadd -UX "Enter repository name" -n '' && { compstate[list]=list; compstate[force_list]=yes; compstate[insert]='' }
+else
+ compadd - \
+ $root/^CVSROOT(:t) \
+ "${(@)${(@M)${(@f)$(<$root/CVSROOT/modules)}:#[^#]*}%%[ ]*}"
+fi
--- /dev/null Sun Jul 25 17:58:12 1999
+++ Completion/User/_cvsrevisions Sun Jul 25 18:13:11 1999
@@ -0,0 +1,3 @@
+#autoload
+
+compadd - "${(@)${(@)${(@M)${(@f)$(cvs -q status -vl .)}:# *}##[ ]##}%%[ ]*}"
--- /dev/null Sun Jul 25 17:58:12 1999
+++ Completion/User/_cvstargets Sun Jul 25 18:13:11 1999
@@ -0,0 +1,9 @@
+#autoload
+
+local pref entries
+_cvsprefix
+_cvsentries
+
+compadd - $entries
+
+compgen -g "^CVS(/)"
--- /dev/null Sun Jul 25 17:58:12 1999
+++ Completion/User/_cvstest Sun Jul 25 18:13:11 1999
@@ -0,0 +1,3 @@
+#compdef cvstest
+
+_cvstargets
--
Tanaka Akira
next prev parent reply other threads:[~1999-07-25 9:23 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-07-21 11:27 Sven Wischnowsky
1999-07-21 12:35 ` Tanaka Akira
1999-07-21 15:43 ` Tanaka Akira
1999-07-21 15:54 ` Bart Schaefer
1999-07-25 9:23 ` Tanaka Akira [this message]
1999-07-25 11:38 ` Tanaka Akira
1999-07-26 4:48 ` Tanaka Akira
1999-07-26 16:26 ` Tanaka Akira
1999-07-26 17:10 ` Tanaka Akira
1999-07-27 7:48 ` PATCH: " Bart Schaefer
1999-07-27 8:12 ` Peter Stephenson
1999-07-27 10:07 ` Tanaka Akira
1999-07-27 11:45 ` Tanaka Akira
1999-07-27 13:49 ` Bart Schaefer
1999-07-27 13:58 ` Tanaka Akira
1999-07-27 14:11 ` Tanaka Akira
1999-07-28 16:05 ` Tanaka Akira
1999-07-27 8:15 ` Peter Stephenson
1999-07-27 8:58 ` Tanaka Akira
-- strict thread matches above, loose matches on Subject: below --
1999-07-22 6:43 Sven Wischnowsky
1999-07-14 12:46 PATCH: Re: Completion/User functions again Sven Wischnowsky
1999-07-14 13:12 ` Tanaka Akira
1999-07-20 18:05 ` CVS completer (Re: PATCH: Re: Completion/User functions again) Bart Schaefer
1999-07-26 0:52 ` Tanaka Akira
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=rsqvhb9ulqj.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).