zsh-workers
 help / color / mirror / code / Atom feed
* Re: Bug#538090: completion: reportbug also accepts filenames
       [not found]   ` <87r5w8gma8.fsf@marvin.43-1.org>
@ 2010-11-14 20:41     ` Clint Adams
  0 siblings, 0 replies; only message in thread
From: Clint Adams @ 2010-11-14 20:41 UTC (permalink / raw)
  To: zsh-workers; +Cc: Ansgar Burchardt, 538090

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-11-14 20:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20090722234917.5047.46019.reportbug@marvin.43-1.org>
     [not found] ` <20090723014702.GA15115@scru.org>
     [not found]   ` <87r5w8gma8.fsf@marvin.43-1.org>
2010-11-14 20:41     ` Bug#538090: completion: reportbug also accepts filenames Clint Adams

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).