Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Fwd: [Pkg-zsh-devel] Bug#681518: [zsh] dpkg --print-foreign-architectures isn't filled automatically by zsh when tab is pressed [origin: sebastian@xxxxxxxxxxx]



Hi,

attached a patch which expands zsh's dpkg tab completion by some more
recent options. Initially reported in Debian at
https://bugs.debian.org/681518, patch submitted at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=681518#13

The patch (also in the attached mail) applies cleanly again zsh git
HEAD.

		Kind regards, Axel
-- 
/~\  Plain Text Ribbon Campaign                   | Axel Beckert
\ /  Say No to HTML in E-Mail and News            | abe@xxxxxxxxxxxxxxx  (Mail)
 X   See http://www.nonhtmlmail.org/campaign.html | abe@xxxxxxxxx (Mail+Jabber)
/ \  I love long mails: http://email.is-not-s.ms/ | http://noone.org/abe/ (Web)
--- Begin Message ---
Control: tags -1 + patch

Hi,

On 2012-07-14 00:06:32, Mika Suomalainen wrote:
> This should probably be changed as "dpkg is missing multiarch related
> option fillings", because it seems that --add-architecture and
> --remove-architecture are missing too.

I've attached a patch that adds --add-architecture, --remove-architecture and
--print-foreign-architectures.

Regards
-- 
Sebastian Ramacher
diff --git a/Completion/Debian/Command/_dpkg b/Completion/Debian/Command/_dpkg
index e7184e7..3503d09 100644
--- a/Completion/Debian/Command/_dpkg
+++ b/Completion/Debian/Command/_dpkg
@@ -50,6 +50,9 @@ _dpkg_actions=(
   '--yet-to-unpack[list uninstalled]'
   '--print-architecture[print target architecture]'
   '--print-installation-architecture'
+  '--print-foreign-architectures[print list of extra architectures]'
+  '--add-architecture[add extra architecture]:architecture:->add_architecture'
+  '--remove-architecture[remove extra architecture]:architecture:->remove_architecture'
   '--compare-versions[compare version numbers]:*::expression:= ->compare_versions'
 )
 
@@ -179,4 +182,13 @@ case "$state" in
     _call_function ret _dpkg_$state && return ret
     _files
   ;;
+  add_architecture)
+    _call_function ret _dpkg_$state && return ret
+    _wanted architecture expl 'extra architecture' \
+      compadd ${(f)"$(dpkg-architecture -L 2>/dev/null)"}
+  ;;
+  remove_architecture)
+    _call_function ret _dpkg_$state && return ret
+    _wanted architecture expl 'extra architecture' \
+      compadd ${(f)"$(dpkg --print-foreign-architectures 2>/dev/null)"}
 esac

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Pkg-zsh-devel mailing list
Pkg-zsh-devel@xxxxxxxxxxxxxxxxxxxxxxx
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-zsh-devel

--- End Message ---


Messages sorted by: Reverse Date, Date, Thread, Author