Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: _dput
- X-seq: zsh-workers 23781
- From: Clint Adams <clint@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: PATCH: _dput
- Date: Sun, 19 Aug 2007 11:51:46 -0400
- In-reply-to: <20070819110421.GA9673@xxxxxxxxxxx>
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20070819110421.GA9673@xxxxxxxxxxx>
> Instead of _hosts, this should parse the output of dput -H.
Like this
Index: Completion/Debian/Command/_dput
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Debian/Command/_dput,v
retrieving revision 1.6
diff -u -r1.6 _dput
--- Completion/Debian/Command/_dput 19 Aug 2007 11:06:04 -0000 1.6
+++ Completion/Debian/Command/_dput 19 Aug 2007 15:51:04 -0000
@@ -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 @@
'(-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 "$@"
Messages sorted by:
Reverse Date,
Date,
Thread,
Author