about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorPaul Ackersviller <packersv@users.sourceforge.net>2007-11-19 03:33:12 +0000
committerPaul Ackersviller <packersv@users.sourceforge.net>2007-11-19 03:33:12 +0000
commitdaa22a771dde6323ed35b7b0bdf7f90ed33a0420 (patch)
treebb72408ca27c51f6dcaacf04e865c08e809b9b28 /Completion
parente1063e1be8cc4513cc9e5284453b918110bf0b25 (diff)
downloadzsh-daa22a771dde6323ed35b7b0bdf7f90ed33a0420.tar.gz
zsh-daa22a771dde6323ed35b7b0bdf7f90ed33a0420.tar.xz
zsh-daa22a771dde6323ed35b7b0bdf7f90ed33a0420.zip
Merge of 23686: respect TIN_HOMEDIR environment variable.
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_tin52
1 files changed, 52 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_tin b/Completion/Unix/Command/_tin
new file mode 100644
index 000000000..c63ccd9e6
--- /dev/null
+++ b/Completion/Unix/Command/_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:_newsgroups' && return 0
+
+if [[ "$state" = newshosts ]]; then
+  newshosts=( ${${(f)"$(<${TIN_HOMEDIR:-$HOME}/.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
+