zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <clint@zsh.org>
To: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
Cc: zsh-workers@sunsite.dk
Subject: PATCH: Re: PATCH: update-alternatives completion
Date: Tue, 29 May 2001 08:32:12 -0400	[thread overview]
Message-ID: <20010529083212.A31244@dman.com> (raw)
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 <path> <name> <path>.

> 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'
 	;;
 


  parent reply	other threads:[~2001-05-29 12:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-28 19:05 Clint Adams
2001-05-29  7:25 ` Sven Wischnowsky
2001-05-29  7:31   ` Andrej Borsenkow
2001-05-29 12:34     ` Clint Adams
2001-05-29 14:28       ` Andrej Borsenkow
2001-05-29 12:32   ` Clint Adams [this message]
2001-05-29 13:08     ` PATCH: " Sven Wischnowsky
2001-05-29 14:19       ` 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=20010529083212.A31244@dman.com \
    --to=clint@zsh.org \
    --cc=wischnow@informatik.hu-berlin.de \
    --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).