From: Clint Adams <clint@zsh.org>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: _dput
Date: Sun, 19 Aug 2007 11:51:46 -0400 [thread overview]
Message-ID: <20070819155146.GA17588@scowler.net> (raw)
In-Reply-To: <20070819110421.GA9673@scowler.net>
> 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 "$@"
next prev parent reply other threads:[~2007-08-19 15:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-19 11:04 Clint Adams
2007-08-19 15:51 ` Clint Adams [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-11-15 19:36 Clint Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070819155146.GA17588@scowler.net \
--to=clint@zsh.org \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).