From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18714 invoked from network); 29 May 2001 12:32:26 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 May 2001 12:32:26 -0000 Received: (qmail 14071 invoked by alias); 29 May 2001 12:32:19 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14533 Received: (qmail 14049 invoked from network); 29 May 2001 12:32:17 -0000 Date: Tue, 29 May 2001 08:32:12 -0400 From: Clint Adams To: Sven Wischnowsky Cc: zsh-workers@sunsite.dk Subject: PATCH: Re: PATCH: update-alternatives completion Message-ID: <20010529083212.A31244@dman.com> References: <20010528150509.A19581@dman.com> <200105290725.JAA08735@beta.informatik.hu-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200105290725.JAA08735@beta.informatik.hu-berlin.de>; from wischnow@informatik.hu-berlin.de on Tue, May 29, 2001 at 09:25:01AM +0200 > To solve this, we invented the `= ' prefix for _argument actions, i.e.: > just change the above to `...:= ->install' and so on. That did the trick. > By this description I don't know what you mean -- and without anything > debianish here I can't really try. But anyway, you'd need some kind of > loop around the `case...esac' to enable these: > > > + '--slave:*::slave:->islave' \ > > But of course you know that... Here's an example of a valid command: update-alternatives --quiet --install /usr/bin/awk awk /usr/bin/gawk 10 \ --slave /usr/share/man/man1/awk.1.gz awk.1.gz /usr/share/man/man1/gawk.1.gz \ --slave /usr/bin/nawk nawk /usr/bin/gawk \ --slave /usr/share/man/man1/nawk.1.gz nawk.1.gz /usr/share/man/man1/gawk.1.gz For each --slave, you repeat the . > Isn't there a better description than `altname'? Or is this some well > known, recognised word in the debian world? No, it's not. I've changed it to `name' for now, though `alternative name' would be correct as well, I suppose. > P.S.: Too late now, but do you really like these mixed underscore/hyphen > names? No, I actually typed _update_alternatives in .distfiles, but of course that didn't work out well seeing as how the file is named something else. > P.P.S.: A command name with 19 characters? What are we coming to... ;-) I guess you haven't seen /usr/sbin/upgrade-windowmaker-defaults Index: Completion/Debian/Command/_dpkg =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Debian/Command/_dpkg,v retrieving revision 1.2 diff -u -r1.2 _dpkg --- Completion/Debian/Command/_dpkg 2001/05/28 18:59:03 1.2 +++ Completion/Debian/Command/_dpkg 2001/05/29 12:15:40 @@ -58,7 +58,7 @@ '--print-architecture[print target architecture]' \ '--print-gnu-build-architecture[print GNU version of target architecture]' \ '--print-installation-architecture[print host architecture]' \ - '--compare-versions[compare version numbers]:*:expression:->compare_versions') + '--compare-versions[compare version numbers]:*::expression:= ->compare_versions') _dpkg_options=('--abort-after[abort after errors]:number of errors:' \ '--admindir=[data directory]:directory:_files -/' \ Index: Completion/Debian/Command/_update-alternatives =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Debian/Command/_update-alternatives,v retrieving revision 1.1 diff -u -r1.1 _update-alternatives --- Completion/Debian/Command/_update-alternatives 2001/05/28 19:06:51 1.1 +++ Completion/Debian/Command/_update-alternatives 2001/05/29 12:15:40 @@ -10,11 +10,11 @@ '--version' \ '--altdir:altdir:_files -/' \ '--admindir:admindir:_files -/' \ - '--install:*::alt:->install' \ - '--remove:*::alt:->remove' \ - '--auto:altname:_files -W /var/lib/dpkg/alternatives' \ - '--display:altname:_files -W /var/lib/dpkg/alternatives' \ - '--config:altname:_files -W /var/lib/dpkg/alternatives' && return 0 + '--install:*::alt:= ->install' \ + '--remove:*::alt:= ->remove' \ + '--auto:name:_files -W /var/lib/dpkg/alternatives' \ + '--display:name:_files -W /var/lib/dpkg/alternatives' \ + '--config:name:_files -W /var/lib/dpkg/alternatives' && return 0 _call_function ret _update_alternatives_$state && return ret case "$state" in @@ -34,7 +34,7 @@ remove) _arguments \ - '1:altname:_files -W /var/lib/dpkg/alternatives' \ + '1:name:_files -W /var/lib/dpkg/alternatives' \ '2:path:_files' ;;