about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2001-02-01 15:00:42 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2001-02-01 15:00:42 +0000
commit92f2594aec41efd999fad775baac1fd12b91533e (patch)
tree65829cfb90762ae6570546a7f814814797a9a1c6
parent79b9ccd285d54f25d0296c8e18f33bdf34b95c10 (diff)
downloadzsh-92f2594aec41efd999fad775baac1fd12b91533e.tar.gz
zsh-92f2594aec41efd999fad775baac1fd12b91533e.tar.xz
zsh-92f2594aec41efd999fad775baac1fd12b91533e.zip
new completion function for the tin newsreader (13420)
-rw-r--r--ChangeLog5
-rw-r--r--Completion/User/_tin52
2 files changed, 57 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 9142942e4..99f201ea6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2001-02-01  Oliver Kiddle  <opk@zsh.org>
+
+	* 13420: Completion/User/_tin: new completion function for tin
+
 2001-01-31  Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru>
 
 	* 13412: Src/mkmakemod.sh: avoid duplicate subdirectories in
@@ -8,6 +12,7 @@
 	* unposted: ChangeLog: typo in previous commit message
 
 2001-01-28 Felix Rosencrantz <f_rosencrantz@yahoo.com>
+
 	* 13395: Test/54compmatch.ztst, Test/comptest: Added code to
 	test compstate[insert_positions], value of insert_positions are
 	now reported
diff --git a/Completion/User/_tin b/Completion/User/_tin
new file mode 100644
index 000000000..2441acf1f
--- /dev/null
+++ b/Completion/User/_tin
@@ -0,0 +1,52 @@
+#compdef tin rtin
+
+local newshosts expl state line curcontext="$curcontext" ret=1
+
+_arguments -C -s \
+  '-a[toggle color flag]' \
+  '-A[force authentication on connect]' \
+  '-c[mark all news as read in subscribed groups]' \
+  "-d[don't show newsgroup descriptions]" \
+  '-f[specify newsrc file to use]:newsrc file:_files' \
+  '-G[specify limit to articles/group to get]:number of articles/group to get' \
+  '-g[specify NNTP server]:NNTP server:->newshosts' \
+  '-h[display help on tin usage]' \
+  '-H[display help information]' \
+  '-I[specify news index file directory]:news index file directory:_files -/' \
+  '-l[get number of articles per group from the active file]' \
+  '-m[specify mailbox directory]:mailbox directory:_files -/' \
+  '-M[mail new news to specified user]:user:_users' \
+  '-n[only read subscribed groups from server]' \
+  '-N[mail new news to yourself]' \
+  '-o[post all postponed articles and exit]' \
+  '-p[specify port to connect to NNTP server]:NNTP port:_ports' \
+  "-q[don't check for new newsgroups]" \
+  '-Q[quick start. Same as -nqd]' \
+  ${${service:#r*}:+-r\[read news remotely over NNTP\]} \
+  '-R[read news saved with -S]' \
+  '-s[specify saved news directory]:saved news directory:_files -/' \
+  '-S[save new news for later reading]' \
+  '-u[update index files]' \
+  '-U[update index files in the background while reading news]' \
+  '-v[verbose output in batch mode]' \
+  '-V[display version information]' \
+  '-w[post an article and exit]' \
+  "-X[don't save any files on quit]" \
+  '-z[start if any unread news]' \
+  '-Z[return status to indicate if any unread news]' \
+  '::newsgroup' && return 0
+
+if [[ "$state" = newshosts ]]; then
+  newshosts=( ${${(f)"$(<~/.tin/newsrctable)"}%%\#*} ) 2>/dev/null
+  _tags hosts nicknames
+  while _tags; do
+    _requested hosts expl 'NNTP server hostname' \
+        compadd ${=newshosts#*[[:blank:]]##[^[:blank:]]*[[:blank:]]} && ret=0
+    _requested nicknames expl 'NNTP server nickname' \
+        compadd -M 'r:|.=* r:|=*' ${newshosts%%[[:blank:]]*} && ret=0
+    (( ret )) || return 0
+  done
+fi
+
+return 1
+