summary refs log tree commit diff
path: root/Completion/Debian
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2007-08-19 15:53:23 +0000
committerClint Adams <clint@users.sourceforge.net>2007-08-19 15:53:23 +0000
commit1380ae67c2a700a43df04da5680ef5cbcf9088f6 (patch)
tree58d6ad310b7996923a74acf4459fecc978c40512 /Completion/Debian
parente7932926a6b668d4c854abfaa0ffc86a1ca6b780 (diff)
downloadzsh-1380ae67c2a700a43df04da5680ef5cbcf9088f6.tar.gz
zsh-1380ae67c2a700a43df04da5680ef5cbcf9088f6.tar.xz
zsh-1380ae67c2a700a43df04da5680ef5cbcf9088f6.zip
23781: base host completion on output of `dput -H`.
Diffstat (limited to 'Completion/Debian')
-rw-r--r--Completion/Debian/Command/_dput17
1 files changed, 16 insertions, 1 deletions
diff --git a/Completion/Debian/Command/_dput b/Completion/Debian/Command/_dput
index 9c6fc02b1..01aac15e0 100644
--- a/Completion/Debian/Command/_dput
+++ b/Completion/Debian/Command/_dput
@@ -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 "$@"