1#compdef dput 2 3_dput() { 4 local -a all_opts dput_opts dput_ng_opts 5 6 all_opts=( 7 '(-c --config)'{-c,--config}'[specify config file]:config file:_files' 8 '(-h --help)'{-h,--help}'[show help message and exit]' 9 '(-f --force)'{-f,--force}'[force an upload]' 10 '(-P --passive)'{-P,--passive}'[use passive FTP for uploads]' 11 '(-U --no-upload-log)'{-U,--no-upload-log}'[do not write an .upload log after uploading]' 12 '(-D --dinstall)'{-D,--dinstall}'[run dinstall after upload]' 13 '(-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)' 14 '(-l --lintian)'{-l,--lintian}'[run lintian before upload]' 15 '(-o --check-only)'{-o,--check-only}'[check the package, do not upload]' 16 '(-u --unchecked)'{-u,--unchecked}'[do not check GPG signature on the changes file]' 17 '(-v --version)'{-v,--version}'[show version information]' 18 '1::host:_dput_hosts' 19 '*:changes file:_files -g "*.changes(-.)"' 20 ) 21 22 dput_opts=( 23 '(-d --debug)'{-d,--debug}'[debug mode]' 24 '(-H --host-list)'{-H,--host-list}'[display host list]' 25 '(-s --simulate)'{-s,--simulate}'[simulate an upload only]' 26 '(-p --print)'{-p,--print}'[print configuration]' 27 ) 28 29 dput_ng_opts=( 30 '*'{-d,--debug}'[enable debug messages, repeat twice to increase the verbosity level]' 31 '*'{-s,--simulate}'[simulate an upload only, repeat twice to increase level of simulation]' 32 '(-F --full-upload-log)'{-F,--full-upload-log}'[write more verbose .upload logs]' 33 ) 34 35 if _pick_variant dputng="usage: dput" dput -H ; then 36 _arguments \ 37 "$all_opts[@]" "$dput_ng_opts[@]" 38 else 39 _arguments \ 40 "$all_opts[@]" "$dput_opts[@]" 41 fi 42} 43 44_dput_hosts() { 45 local expl 46 47 if ( [[ ${+_dput_cfhosts} -eq 0 ]] || _cache_invalid dputhosts ) && ! _retrieve_cache dputhosts; then 48 local cmd 49 if _pick_variant dputng="usage: dput" dput -H ; then 50 cmd=(dirt hosts) 51 else 52 cmd=(dput -H) 53 fi 54 _dput_cfhosts=(${${(M)${(f)"$($cmd)"}:#*=>*}/ =>*/}) 55 _store_cache dputhosts _dput_cfhosts 56 fi 57 58 _wanted dputhosts expl 'target host' compadd -a _dput_cfhosts 59} 60 61_dput "$@" 62