1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-01 06:20:55 +01:00

add completion for newsgroups (13448)

This commit is contained in:
Oliver Kiddle 2001-02-08 17:50:26 +00:00
parent 14d2dae44c
commit 5723d260c0
5 changed files with 19 additions and 4 deletions

View file

@ -1,5 +1,9 @@
2001-02-08 Oliver Kiddle <opk@zsh.org>
* 13448: Completion/User/.distfiles, Completion/User/_tin,
Completion/User/_netscape, Completion/User/_newsgroups:
add newsgroup completion
* 13445: Completion/User/_gzip: fix to work for zcat again
2001-02-07 Bart Schaefer <schaefer@zsh.org>

View file

@ -7,12 +7,12 @@ DISTFILES_SRC='
_gs _gv _gzip _hosts _imagemagick _ispell
_java _joe _killall _lp _look _lynx _lzop
_mailboxes _make _man _mere _mh _mount _mutt _my_accounts _mysql_utils
_nedit _netscape _nslookup _other_accounts
_nedit _netscape _newsgroups _nslookup _other_accounts
_pack _patch _pbm _pdf _perl _perl_basepods _perl_builtin_funcs
_perl_modules _perldoc _ports _prcs _printers _prompt _ps _pspdf
_psutils _rcs _rlogin
_sh _slrn _socket _ssh _strip _stty _su _sudo
_tar _tar_archive _telnet _tex _texi _tiff _tilde_files
_tar _tar_archive _telnet _tex _texi _tiff _tilde_files _tin
_urls _use_lo _user_at_host _users _users_on
_webbrowser _wget _whereis _whois _xargs _yodl _yp
_zcat _zdump

View file

@ -74,13 +74,15 @@ if [[ "$state" = "urls" ]]; then
_wanted values expl 'about what' \
compadd "$@" authors blank cache document fonts global hype image-cache \
license logo memory-cache mozilla plugins && ret=0
elif compset -P news: ; then
_newsgroups "$@" && ret=0
else
_tags prefixes
while _tags; do
while _next_label prefixes expl 'URL prefix' "$@"; do
_urls "$expl[@]" && ret=0
compset -S '[^:]*'
compadd -S '' "$expl[@]" about: mocha: javascript: && ret=0
compadd -S '' "$expl[@]" about: news: mocha: javascript: && ret=0
done
(( ret )) || return 0
done

View file

@ -0,0 +1,9 @@
#autoload
local expl
: ${(A)_cache_newsgroups:=${${(f)"$(fgrep -vh \! ~/.newsrc*)"}%:*}}
(( ${(w)#_cache_newsgroups} )) && _wanted newsgroups expl 'newsgroup' \
_multi_parts "$@" -i . _cache_newsgroups

View file

@ -34,7 +34,7 @@ _arguments -C -s \
"-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
'::newsgroup:_newsgroups' && return 0
if [[ "$state" = newshosts ]]; then
newshosts=( ${${(f)"$(<~/.tin/newsrctable)"}%%\#*} ) 2>/dev/null