1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-04 10:41:11 +02:00

23781: base host completion on output of dput -H.

This commit is contained in:
Clint Adams 2007-08-19 15:53:23 +00:00
parent e7932926a6
commit 1380ae67c2
2 changed files with 19 additions and 1 deletions

View file

@ -1,5 +1,8 @@
2007-08-19 Clint Adams <clint@zsh.org>
* 23781: Completion/Debian/Command/_dput: base host completion
on output of `dput -H`.
* 23780: Completion/Debian/Command/_dput: add -e, -H, and
optional host argument.

View file

@ -1,5 +1,6 @@
#compdef dput
_dput() {
_arguments \
'(-c --config)'{-c,--config}'[specify config file]:config file:_files' \
'(-d --debug)'{-d,--debug}'[debug mode]' \
@ -13,5 +14,19 @@ _arguments \
'(-s --simulate)'{-s,--simulate}'[simulate an upload only]' \
'(-u --unchecked)'{-u,--unchecked}'[do not check GPG signature on the changes file]' \
'(-v --version)'{-v,--version}'[show version information]' \
'1::host:_hosts' \
'1::host:_dput_hosts' \
'*:changes file:_files -g "*.changes(-.)"'
}
_dput_hosts() {
local expl
if ( [[ ${+_dput_cfhosts} -eq 0 ]] || _cache_invalid dputhosts ) && ! _retrieve_cache dputhosts; then
_dput_cfhosts=(${${(M)${(f)"$(dput -H)"}:#*=>*}/ =>*/})
_store_cache dputhosts _dput_cfhosts
fi
_wanted dputhosts expl 'target host' compadd -a _dput_cfhosts
}
_dput "$@"