From: Clint Adams <clint@zsh.org>
To: zsh-workers@zsh.org
Cc: Ansgar Burchardt <ansgar@43-1.org>, 538090@bugs.debian.org
Subject: Re: Bug#538090: completion: reportbug also accepts filenames
Date: Sun, 14 Nov 2010 20:41:40 +0000 [thread overview]
Message-ID: <20101114204140.GA13563@scru.org> (raw)
In-Reply-To: <87r5w8gma8.fsf@marvin.43-1.org>
On Thu, Jul 23, 2009 at 04:34:23AM +0200, Ansgar Burchardt wrote:
> > And it should only offer the filenames if you've already typed something
> > beginning with a slash?
>
> Yes, that would be perfect. From the man page:
>
> You may specify either a package name or an absolute filename; if
> you use a filename, it must begin with a / to be recognized.
Index: Completion/Debian/Command/_bug
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Debian/Command/_bug,v
retrieving revision 1.7
diff -u -r1.7 _bug
--- Completion/Debian/Command/_bug 10 Dec 2009 20:49:39 -0000 1.7
+++ Completion/Debian/Command/_bug 14 Nov 2010 20:36:44 -0000
@@ -1,5 +1,6 @@
#compdef bug reportbug querybts
+local expl
local _bug_commonargs _rb_commonargs
_bug_commonargs=(
@@ -7,7 +8,7 @@
'-m[maintainer-only]'
'-p[print to stdout instead of mail]'
'-h[help]'
- '*:package:_deb_packages installed'
+ '*:packageorfile:->pkgorfile'
)
_rb_commonargs=(
@@ -29,7 +30,7 @@
'-v[version]' \
'-x[do not cc submitter]' \
'-z[send configs verbatim]' \
- "$_bug_commonargs[@]"
+ "$_bug_commonargs[@]" && return
;;
reportbug)
_arguments \
@@ -93,7 +94,7 @@
'--body=:message body string' \
'--body-file=:message body file:_files' \
"$_bug_commonargs[@]" \
- "$_rb_commonargs[@]"
+ "$_rb_commonargs[@]" && return
;;
querybts)
_arguments \
@@ -102,6 +103,15 @@
'(-s --source)'{-s,--source}'[query for source packages rather than binary]' \
'(-v --version)'{-v,--version}'[show version]' \
"$_rb_commonargs[@]" \
- '*:package:_deb_packages avail'
+ '*:package:_deb_packages avail' && return
;;
esac
+
+case "$service:$state:${words[CURRENT]}" in
+ (reportbug:pkgorfile:/*)
+ _wanted tag expl 'file' _files
+ ;;
+ (reportbug:pkgorfile:*)
+ _wanted tax expl 'package' _deb_packages installed
+ ;;
+esac
parent reply other threads:[~2010-11-14 20:38 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <87r5w8gma8.fsf@marvin.43-1.org>]
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=20101114204140.GA13563@scru.org \
--to=clint@zsh.org \
--cc=538090@bugs.debian.org \
--cc=ansgar@43-1.org \
--cc=zsh-workers@zsh.org \
/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).