]> git.pld-linux.org Git - packages/zsh.git/blame - zsh-completions.patch
- adapterized _sms to zsh 4.1.1
[packages/zsh.git] / zsh-completions.patch
CommitLineData
0380bfc9 1diff -ruN zsh-4.0.6./Completion/Unix/Command/.distfiles zsh-4.0.6/Completion/Unix/Command/.distfiles
e526ea95
TP
2--- zsh-4.1.1.orig/Completion/Unix/Command/.distfiles Fri Aug 9 15:30:12 2002
3+++ zsh-4.1.1/Completion/Unix/Command/.distfiles Mon Apr 21 17:46:39 2003
29aa0332
TP
4@@ -20,5 +20,5 @@
5 _netcat _larch _texinfo _figlet _elinks _tidy
6 _global _global_tags _ant _lsof _mt _xmlsoft
7 _perforce _python _antiword _screen _renice
8-_ecasound _gpg
9+_ecasound _gpg _sms
0380bfc9 10 '
0380bfc9 11diff -ruN zsh-4.0.6./Completion/Unix/Command/_sms zsh-4.0.6/Completion/Unix/Command/_sms
e526ea95
TP
12--- zsh-4.1.1.orig/Completion/Unix/Command/_sms Thu Jan 1 01:00:00 1970
13+++ zsh-4.1.1/Completion/Unix/Command/_sms Fri Apr 4 20:17:13 2003
0380bfc9 14@@ -0,0 +1,61 @@
15+#compdef sms smsaddr
16+
17+# Copyright (c) 2002 GoTaR <gotar@priv0.onet.pl>
18+
19+#_sms_aliases0 () {
20+## compadd "$@" $(print ${(f)"$(smsaddr -l | cut -f1)"})
21+# local smsas
22+# smsas=(`smsaddr -l | perl -ne 's/ +/:/; if (/^'$PREFIX'/) {print} else {if (/:'$PREFIX'/) {/^(.*):(.*)$/; print "$2:$1 "}}'`)
23+# _describe "SMS alias" "smsas"
24+#}
25+
26+_sms_aliases () {
27+ local smsas
28+ smsas=(${(f)"$(smsaddr -l)"})
29+ smsas=(${smsas/ ##/:})
e526ea95 30+if [[ -n "$PREFIX$SUFFIX" ]]; then
0380bfc9 31+ smsas=($smsas ${smsas/(#s)(#b)(^($PREFIX)*):(*)(#e)/$match[3]:$match[1]})
e526ea95 32+fi
0380bfc9 33+# smsas=(${(M)smsas:#$PREFIX*})
34+ _describe "SMS alias" smsas
35+}
36+
37+_sms_alias () {
38+ local smsas
39+ smsas=(${(f)"$(smsaddr -l)"})
40+ smsas=(${smsas/ ##/:})
41+ _describe "SMS alias" smsas
42+}
43+
44+#_sms_aliases1 () {
45+#smsaddr -l | while read alias number; do
46+# if [[ $alias == $PREFIX*$SUFFIX || $number == $PREFIX*$SUFFIX ]]; then
47+# compadd -U -- $alias
48+# fi
49+#done
50+#}
51+
52+case "$service" in
53+sms)
54+ _arguments \
55+ '1:SMS alias or number:_sms_aliases' \
56+ ':message:_guard' \
57+ '--split[split to max n messages]:number of messages:(2 5 9)' \
58+ '--supersms[send via SuperSMS.pl gateway]' \
59+ '--czat[send via Idea.czat gateway]' \
60+ '--dlogin[login for Idea.czat]:login:_guard' \
61+ '--pf[send via Panorama Firm gateway]' \
62+ '--plusmail[send message to PlusGSM network via e-mail gateway, not www]' \
63+ '--cfg[config file]:config file:_files' \
64+ '--check[check for the new version of this program]' \
65+ '--from[sender e-mail adress for PlusGSM and Idea gateways]:e-mail:_guard' \
66+ '--ip[sender IP]:IP:_guard' \
67+ '--sign[set signature]:signature:_guard' \
68+ '--thanksto'
69+ ;;
70+smsaddr)
71+ _arguments \
72+ '(-r -l)-a[add new entry]:New entry name:_guard:Phone number:_guard' \
73+ '(-a -l)-r[remove existing entry]:SMS alias:_sms_alias' \
74+ '(-a -r)-l[list entry]:SMS alias:_sms_alias'
75+esac
This page took 0.071977 seconds and 4 git commands to generate.