diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2013-11-07 14:52:31 +0100 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2013-11-07 14:52:31 +0100 |
commit | d799ac78a744a5359563af55b4dee9e91255a1dc (patch) | |
tree | 73475ed7089e6ee050085a96b88018994b43bdfc /Completion/Debian/Command | |
parent | abfb3b136a4ad5b2832fb7d920442a2bb28c0697 (diff) | |
parent | 375115c7dfd6dff576915d25fe2ecdd381dd9d81 (diff) | |
download | zsh-d799ac78a744a5359563af55b4dee9e91255a1dc.tar.gz zsh-d799ac78a744a5359563af55b4dee9e91255a1dc.zip |
Merge branch 'upstream' into debian
Diffstat (limited to 'Completion/Debian/Command')
-rw-r--r-- | Completion/Debian/Command/.distfiles | 2 | ||||
-rw-r--r-- | Completion/Debian/Command/_dak | 4 | ||||
-rw-r--r-- | Completion/Debian/Command/_dcut | 160 | ||||
-rw-r--r-- | Completion/Debian/Command/_dput | 61 | ||||
-rw-r--r-- | Completion/Debian/Command/_linda | 26 |
5 files changed, 210 insertions, 43 deletions
diff --git a/Completion/Debian/Command/.distfiles b/Completion/Debian/Command/.distfiles index 772d08089..ed1575091 100644 --- a/Completion/Debian/Command/.distfiles +++ b/Completion/Debian/Command/.distfiles @@ -14,6 +14,7 @@ _cdbs-edit-patch _dak _dchroot _dchroot-dsa +_dcut _debchange _debdiff _debfoster @@ -30,7 +31,6 @@ _dupload _git-buildpackage _invoke-rc.d _lighttpd -_linda _lintian _madison _make-kpkg diff --git a/Completion/Debian/Command/_dak b/Completion/Debian/Command/_dak index 5aaaeefbc..840fc0017 100644 --- a/Completion/Debian/Command/_dak +++ b/Completion/Debian/Command/_dak @@ -238,6 +238,10 @@ case $cmd in ) ;; + (*) + _files + ;; + esac _arguments -s "$args[@]" && ret=0 diff --git a/Completion/Debian/Command/_dcut b/Completion/Debian/Command/_dcut new file mode 100644 index 000000000..210d54429 --- /dev/null +++ b/Completion/Debian/Command/_dcut @@ -0,0 +1,160 @@ +#compdef dcut + +# TODO: dcut supports two ways to be called: +# * dcut HOST COMMAND ... +# * dcut COMMAND ... +# So ideally, if the first argument is completed, both commands and hosts should +# be offered. If host is given, the second argument should be completed as +# command and if not, it should be completed as command specific option. + +function _dput_hosts() { + local expl + + if ( [[ ${+_dput_cfhosts} -eq 0 ]] || _cache_invalid dputhosts ) && ! _retrieve_cache dputhosts; then + 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 + fi + + _wanted dputhosts expl 'target host' compadd -a _dput_cfhosts +} + +function _dcut_commands() { + local -a cmds + if _pick_variant dcutng="usage: dcut" dcut -v ; then + cmds=( + dm:'manage Debian Maintainer permissions' + break-the-archive:'break the archive' + reschedule:'reschedule a deferred upload' + cancel:'cancel a deferred upload' + rm:'remove a file from the upload queue' + upload:'upload a command file' + ) + else + cmds=( + rm:'remove a file from the upload queue' + cancel:'cancel a deferred upload' + reschedule:'reschedule a deferred upload' + ) + fi + _describe -t commands command cmds +} + +function _dcut() { + local -a all_opts dcut_opts dcut_ng_opts + local state line context + local -A opt_args + local curcontext="${curcontext}" + + all_opts=( + '(-c --config)'{-c,--config=}'[specify config file]:config file:_files' + '(-h --help)'{-h,--help}'[show help message and exit]' + '(-m --maintainer)'{-m,--maintainer=}'[use maintainer for upload field and GPG key selection]:maintainer address' + '(-k --keyid)'{-k,--keyid}'[use key id for signing]:keyid' + '(-O --output)'{-O,--output=}'[write command file to file instead of uploading]:output file:_files' + '(-P --passive)'{-P,--passive}'[use passive FTP for uploads]' + '(-v --version)'{-v,--version}'[show version information]' + ': :_dcut_commands' + ) + + dcut_opts=( + '(-d --debug)'{-d,--debug}'[debug mode]' + '(-s --simulate)'{-s,--simulate}'[simulate an upload only]' + '(-i --input)'{-i,--input=}'[create commands file to remove every file listed in the changes file]:changes file:_files -g"*.changes(-.)"' + '(-U --upload)'{-U,--upload=}'[upload commands file]:commands file:_files' + '(--host 1)'{--host=}'[upload to host if it is named like a command]:host:_dput_hosts' + '*:: :->dcut_command_arguments' + ) + + dcut_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]' + '*:: :->dcut_ng_command_arguments' + ) + + if _pick_variant dcutng="usage: dcut" dcut -v ; then + _arguments -C \ + "$all_opts[@]" "$dcut_ng_opts[@]" && return + else + _arguments -C \ + "$all_opts[@]" "$dcut_opts[@]" && return + fi + + case $state in + (dcut_command_arguments) + # arguments to dcut commands + local -a opts + case ${line[1]} in + (cancel) + # dcut cancel arguments + opts=( + '1::changes file:_files -g"*.changes(-.)"' + ) + ;; + (reschedule) + # dcut reschedule arguments + opts=( + '1::changes file:_files -g"*.changes(-.)"' + '2::new delayed queue:(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)' + ) + ;; + (rm) + # dcut rm arguments + opts=( + '--searchdirs[search in all directores for the given files]' + '1::file to be deleted:_files' + ) + ;; + esac + _arguments "$opts[@]" && return + ;; + (dcut_ng_command_arguments) + # arguments to dput-ng's dcut commands + local -a opts + case ${line[1]} in + (cancel) + # dcut cancel arguments + opts=( + '(-f --filename)'{-f,--filename}'[.changes file name of the upload to be cancelled]:file name:_files -g"*.changes(-.)"' + ) + ;; + (dm) + # dcut dm arguments + opts=( + '--uid[full name and address or GPG fingerprint of the Debian Maintainer]' + '*--allow[grant permission to upload a source package]:source package' + '*--deny[remove permission to upload a source pckage]:source package' + ) + ;; + (reschedule) + # dcut reschedule arguments + opts=( + '(-f --filename)'{-f,--filename}'[.changes file name to be rescheduled]:file name:_files -g"*.changes(-.)"' + '(-d --days)'{-d,--days}'[new delayed queue]:days:(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)' + ) + ;; + (rm) + # dcut rm arguments + opts=( + '*'{-f,--filename}'[file name to be removed]:file name:_files' + '--searchdirs[search in all directores for the given files]' + ) + ;; + (upload) + # dcut upload arguments + opts=( + '-f --filename)'{-f,--filename}'[file to be uploaded]:file name:_files' + ) + ;; + esac + _arguments "$opts[@]" && return + ;; + esac +} + +_dcut "$@" diff --git a/Completion/Debian/Command/_dput b/Completion/Debian/Command/_dput index 20465346c..bf6c2baee 100644 --- a/Completion/Debian/Command/_dput +++ b/Completion/Debian/Command/_dput @@ -1,28 +1,57 @@ #compdef dput _dput() { -_arguments \ - '(-c --config)'{-c,--config}'[specify config file]:config file:_files' \ - '(-d --debug)'{-d,--debug}'[debug mode]' \ - '(-D --dinstall)'{-D,--dinstall}'[run dinstall after upload]' \ - '(-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)' \ - '(-f --force)'{-f,--force}'[force upload of already uploaded package]' \ - '(-H --host-list)'{-H,--host-list}'[display host list]' \ - '(-l --lintian)'{-l,--lintian}'[run lintian before upload]' \ - '(-o --check-only)'{-o,--check-only}'[check the package, do not upload]' \ - '(-p --print)'{-p,--print}'[print configuration]' \ - '(-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:_dput_hosts' \ - '*:changes file:_files -g "*.changes(-.)"' + local -a all_opts dput_opts dput_ng_opts + + all_opts=( + '(-c --config)'{-c,--config}'[specify config file]:config file:_files' + '(-h --help)'{-h,--help}'[show help message and exit]' + '(-f --force)'{-f,--force}'[force an upload]' + '(-P --passive)'{-P,--passive}'[use passive FTP for uploads]' + '(-U --no-upload-log)'{-U,--no-upload-log}'[do not write an .upload log after uploading]' + '(-D --dinstall)'{-D,--dinstall}'[run dinstall after upload]' + '(-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)' + '(-l --lintian)'{-l,--lintian}'[run lintian before upload]' + '(-o --check-only)'{-o,--check-only}'[check the package, do not upload]' + '(-u --unchecked)'{-u,--unchecked}'[do not check GPG signature on the changes file]' + '(-v --version)'{-v,--version}'[show version information]' + '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() { local expl 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 fi diff --git a/Completion/Debian/Command/_linda b/Completion/Debian/Command/_linda deleted file mode 100644 index 12ca72f3e..000000000 --- a/Completion/Debian/Command/_linda +++ /dev/null @@ -1,26 +0,0 @@ -#compdef linda - -_arguments \ - '(-c --config)'{-c,--config=}':config file:_files' \ - '(-C --checks)'{-C,--checks=}':check regexes:' \ - '(-d --debug)*'{-d,--debug}'[debug]' \ - '(-D --disable-local)*'{-D,--disable-local}'[disable registration of local checks]' \ - '(-f --format)'{-f,--format=}':output format:(branden long lintian figlet)' \ - '(-h --help)'{-h,--help}'[help]' \ - '(-i --info)'{-i,--info}'[info]' \ - '(-l --lab)'{-l,--lab=}':lab root:_files -/' \ - '(-L --list-checks)'{-L,--list-checks=}':list checks:' \ - '(-m --more-overrides)'{-m,--more-overrides=}':more overrides:' \ - '(-n --no-cull)'{-n,--no-cull}'[do not delete lab after completion]' \ - '(-o --show-overridden)'{-o,--show-overridden}'[display errors that are overridden]' \ - '(-p --print-overrides)'{-p,--print-overrides}'[print parsed overrides]' \ - '(-P --profiling)'{-P,--profiling}'[print profiling stats]' \ - '(-q --quiet)'{-q,--quiet}'[quiet]' \ - '(-s --show-tag)'{-s,--show-tag}'[print tag along with errors]' \ - '(-S --seteuid)'{-S,--seteuid}'[do not seteuid to nobody]' \ - '(-t --types)'{-t,--types=}':types string:_values -s , "types" Error Warning eXperimental Informational' \ - '(-T --traceback)'{-T,--traceback}'[show a traceback from any exception]' \ - '(-U --unpack)'{-U,--unpack}':unpack level:' \ - '(-v --verbose)'{-v,--verbose}'[verbose]' \ - '(-V --version)'{-V,--version}'[version]' \ - ':package:_files -g "*.(changes|u#deb|dsc)(-.)"' |