mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-04 22:51:42 +02:00
31500: Completion/Debian/Command/_dput: dput-ng completion support from Sebastian Ramacher.
This commit is contained in:
parent
758d0a605b
commit
96c8b2832b
2 changed files with 48 additions and 16 deletions
|
@ -1,5 +1,8 @@
|
||||||
2013-06-28 Clint Adams <clint@zsh.org>
|
2013-06-28 Clint Adams <clint@zsh.org>
|
||||||
|
|
||||||
|
* 31500: Completion/Debian/Command/_dput: dput-ng completion
|
||||||
|
support from Sebastian Ramacher.
|
||||||
|
|
||||||
* 31499: Completion/Debian/Command/_dcut: dcut completion
|
* 31499: Completion/Debian/Command/_dcut: dcut completion
|
||||||
from Sebastian Ramacher.
|
from Sebastian Ramacher.
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,57 @@
|
||||||
#compdef dput
|
#compdef dput
|
||||||
|
|
||||||
_dput() {
|
_dput() {
|
||||||
_arguments \
|
local -a all_opts dput_opts dput_ng_opts
|
||||||
'(-c --config)'{-c,--config}'[specify config file]:config file:_files' \
|
|
||||||
'(-d --debug)'{-d,--debug}'[debug mode]' \
|
all_opts=(
|
||||||
'(-D --dinstall)'{-D,--dinstall}'[run dinstall after upload]' \
|
'(-c --config)'{-c,--config}'[specify config file]:config file:_files'
|
||||||
'(-e --delayed)'{-E,--delayed}'[number of days in delayed queue]:number of days:(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)' \
|
'(-h --help)'{-h,--help}'[show help message and exit]'
|
||||||
'(-f --force)'{-f,--force}'[force upload of already uploaded package]' \
|
'(-f --force)'{-f,--force}'[force an upload]'
|
||||||
'(-H --host-list)'{-H,--host-list}'[display host list]' \
|
'(-P --passive)'{-P,--passive}'[use passive FTP for uploads]'
|
||||||
'(-l --lintian)'{-l,--lintian}'[run lintian before upload]' \
|
'(-U --no-upload-log)'{-U,--no-upload-log}'[do not write an .upload log after uploading]'
|
||||||
'(-o --check-only)'{-o,--check-only}'[check the package, do not upload]' \
|
'(-D --dinstall)'{-D,--dinstall}'[run dinstall after upload]'
|
||||||
'(-p --print)'{-p,--print}'[print configuration]' \
|
'(-e --delayed)'{-e,--delayed}'[number of days in delayed queue]:number of days:(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)'
|
||||||
'(-s --simulate)'{-s,--simulate}'[simulate an upload only]' \
|
'(-l --lintian)'{-l,--lintian}'[run lintian before upload]'
|
||||||
'(-u --unchecked)'{-u,--unchecked}'[do not check GPG signature on the changes file]' \
|
'(-o --check-only)'{-o,--check-only}'[check the package, do not upload]'
|
||||||
'(-v --version)'{-v,--version}'[show version information]' \
|
'(-u --unchecked)'{-u,--unchecked}'[do not check GPG signature on the changes file]'
|
||||||
'1::host:_dput_hosts' \
|
'(-v --version)'{-v,--version}'[show version information]'
|
||||||
'*:changes file:_files -g "*.changes(-.)"'
|
'1::host:_dput_hosts'
|
||||||
|
'*:changes file:_files -g "*.changes(-.)"'
|
||||||
|
)
|
||||||
|
|
||||||
|
dput_opts=(
|
||||||
|
'(-d --debug)'{-d,--debug}'[debug mode]'
|
||||||
|
'(-H --host-list)'{-H,--host-list}'[display host list]'
|
||||||
|
'(-s --simulate)'{-s,--simulate}'[simulate an upload only]'
|
||||||
|
'(-p --print)'{-p,--print}'[print configuration]'
|
||||||
|
)
|
||||||
|
|
||||||
|
dput_ng_opts=(
|
||||||
|
'*'{-d,--debug}'[enable debug messages, repeat twice to increase the verbosity level]'
|
||||||
|
'*'{-s,--simulate}'[simulate an upload only, repeat twice to increase level of simulation]'
|
||||||
|
'(-F --full-upload-log)'{-F,--full-upload-log}'[write more verbose .upload logs]'
|
||||||
|
)
|
||||||
|
|
||||||
|
if _pick_variant dputng="usage: dput" dput -H ; then
|
||||||
|
_arguments \
|
||||||
|
"$all_opts[@]" "$dput_ng_opts[@]"
|
||||||
|
else
|
||||||
|
_arguments \
|
||||||
|
"$all_opts[@]" "$dput_opts[@]"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_dput_hosts() {
|
_dput_hosts() {
|
||||||
local expl
|
local expl
|
||||||
|
|
||||||
if ( [[ ${+_dput_cfhosts} -eq 0 ]] || _cache_invalid dputhosts ) && ! _retrieve_cache dputhosts; then
|
if ( [[ ${+_dput_cfhosts} -eq 0 ]] || _cache_invalid dputhosts ) && ! _retrieve_cache dputhosts; then
|
||||||
_dput_cfhosts=(${${(M)${(f)"$(dput -H)"}:#*=>*}/ =>*/})
|
local cmd
|
||||||
|
if _pick_variant dputng="usage: dput" dput -H ; then
|
||||||
|
cmd=(dirt hosts)
|
||||||
|
else
|
||||||
|
cmd=(dput -H)
|
||||||
|
fi
|
||||||
|
_dput_cfhosts=(${${(M)${(f)"$($cmd)"}:#*=>*}/ =>*/})
|
||||||
_store_cache dputhosts _dput_cfhosts
|
_store_cache dputhosts _dput_cfhosts
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue