From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 229 invoked from network); 4 Nov 2005 02:21:46 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 4 Nov 2005 02:21:46 -0000 Received: (qmail 63299 invoked from network); 4 Nov 2005 02:21:40 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Nov 2005 02:21:40 -0000 Received: (qmail 2609 invoked by alias); 4 Nov 2005 02:21:36 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21983 Received: (qmail 2600 invoked from network); 4 Nov 2005 02:21:35 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Nov 2005 02:21:35 -0000 Received: (qmail 62964 invoked from network); 4 Nov 2005 02:21:35 -0000 Received: from lorien.emufarm.org (HELO lorien.comfychair.org) (64.81.48.166) by a.mx.sunsite.dk with SMTP; 4 Nov 2005 02:21:34 -0000 Received: from lorien.comfychair.org (localhost [127.0.0.1]) by lorien.comfychair.org (8.13.3/8.13.1) with ESMTP id jA42MRwb010502 for ; Thu, 3 Nov 2005 18:22:27 -0800 Received: (from duvall@localhost) by lorien.comfychair.org (8.13.3/8.13.3/Submit) id jA42MRWW010501 for zsh-workers@sunsite.dk; Thu, 3 Nov 2005 18:22:27 -0800 Date: Thu, 3 Nov 2005 18:22:27 -0800 From: Danek Duvall To: zsh-workers@sunsite.dk Subject: PATCH: _pkg* completion for Solaris Message-ID: <20051104022227.GA3202@lorien.comfychair.org> Mail-Followup-To: Danek Duvall , zsh-workers@sunsite.dk Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline User-Agent: mutt-ng/devel-r535 (Linux) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.0.4 --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I've been meaning to write some completion functions for Solaris-specific utilities and get them added to the zsh distribution if at all possible. Some I've had written for some time, like the following, which are for the packaging commands. I've got some for the SMF and DTrace commands as well, but they need some more work before they're all that good. I'm generally writing to the latest Solaris bits (meaning the latest Nevada bits available through opensolaris). I'm not sure how best to deal with the utilities changing through the releases, as most don't have usefully parseable help outputs. Perhaps a switch on the uname, assuming that anything unrecognized is the latest stuff? Anyway, I'll try to keep these coming. I'd love to have 'em in by default. Thanks, Danek --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="zsh-solaris_pkg.patch" --- Completion/Solaris/Command/_pkgadd.orig 2005-11-03 18:12:14.000000000 -0800 +++ Completion/Solaris/Command/_pkgadd 2005-11-03 17:57:41.000000000 -0800 @@ -0,0 +1,32 @@ +#compdef pkgadd + +_pkgadd_pass() { + _values -S : 'password descriptor' \ + '(file env console)pass[Literal password]:password:' \ + '(pass file console)env[Environment variable]:environment:_parameters -g "*export*"' \ + '(pass env console)file[File]:file:_files' \ + '(pass env file)console[From /dev/tty]' +} + +_pkgadd() { + _arguments -s \ + '-d[Device]:device file:_files' \ + '-x[HTTP(S) proxy]:HTTP proxy: ' \ + '-k[Keystore]:keystore:_files' \ + '-P[Password to decrypt keystore]:password:_pkgadd_pass' \ + '-Y[Select packages by category]:category: ' \ + - set1 \ + '-n[Non-interactive mode]' \ + '-v[Trace all scripts]' \ + '-a[Admin file]:admin file:_files' \ + "-M[Don't use vfstab file]" \ + '-R[Root path]:root path:_files -/' \ + '-r[Response file]:response file:_files' \ + '-V[Alternate vfstab file]:vfstab file:_files' \ + '*:package instance:_pkg_instance --_opts uninstalled:-d' \ + - set2 \ + '-s[Spool package]:spool directory:_files -/' \ + '*:package instance:_pkg_instance --_opts uninstalled:-d' +} + +_pkgadd "$@" --- Completion/Solaris/Command/_pkginfo.orig 2005-11-03 18:12:14.000000000 -0800 +++ Completion/Solaris/Command/_pkginfo 2005-11-03 17:57:41.000000000 -0800 @@ -0,0 +1,22 @@ +#compdef pkginfo + +_pkginfo() { + _arguments -s \ + '(-q -r -x)-l[Long listing]' \ + '(-l -r -x)-q[Quiet mode]' \ + '(-l -q -x)-r[Relocation base]' \ + '(-l -q -r)-x[Extracted listing]' \ + '-c[Category]:category: ' \ + '-a[Architecture]:architecture: ' \ + '-v[Version]:version: ' \ + - set1 \ + '(-p)-i[Select completely installed packages]' \ + '(-i)-p[Select partially installed packages]' \ + '-R[Root path]:root path:_files -/' \ + '*:package instance:_pkg_instance --_opts installed:set1--R' \ + - set2 \ + '-d[Device]:device file:_files' \ + '*:package instance:_pkg_instance --_opts uninstalled:set2--d' +} + +_pkginfo "$@" --- Completion/Solaris/Command/_pkgrm.orig 2005-11-03 18:12:14.000000000 -0800 +++ Completion/Solaris/Command/_pkgrm 2005-11-03 17:57:41.000000000 -0800 @@ -0,0 +1,20 @@ +#compdef pkgrm + +_pkgrm() { + _arguments -s \ + '-Y[Select packages by category]:category: ' \ + - set1 \ + '-n[Non-interactive mode]' \ + '-v[Trace all scripts]' \ + '-a[Admin file]:admin file:_files' \ + "-A[Force removal of all files]" \ + "-M[Don't use vfstab file]" \ + '-R[Root path]:root path:_files -/' \ + '-V[Alternate vfstab file]:vfstab file:_files' \ + '*:package instance:_pkg_instance --_opts installed:set1--R' \ + - set2 \ + '-s[Spool package]:spool directory:_files -/' \ + '*:package instance:_pkg_instance --_opts spooled:set2--s' +} + +_pkgrm "$@" --- Completion/Solaris/Type/_pkg_instance.orig 2005-11-03 18:12:14.000000000 -0800 +++ Completion/Solaris/Type/_pkg_instance 2005-11-03 17:57:41.000000000 -0800 @@ -0,0 +1,20 @@ +#autoload + +local -A opts +local whicharg + +zparseopts -E -D -- '-_opts:=opts' + +whicharg=${opts#*:} + +case ${opts%:*} in +(installed) + compadd "$@" - ${opt_args[$whicharg]}/var/sadm/pkg/*/pkginfo(:h:t) + ;; +(spooled) + compadd "$@" - ${opt_args[$whicharg]}/*(:t) + ;; +(uninstalled) + compadd "$@" - ${opt_args[$whicharg]:-/var/spool/pkg}/*/pkgmap(:h:t) + ;; +esac --- Src/Zle/complete.mdd.orig 2005-01-12 09:29:06.000000000 -0800 +++ Src/Zle/complete.mdd 2005-11-03 18:11:48.000000000 -0800 @@ -1,7 +1,7 @@ name=zsh/complete link=either load=yes -functions='Completion/*comp* Completion/AIX/*/* Completion/BSD/*/* Completion/Base/*/* Completion/Cygwin/*/* Completion/Darwin/*/* Completion/Debian/*/* Completion/Linux/*/* Completion/Mandrake/*/* Completion/Redhat/*/* Completion/Unix/*/* Completion/X/*/* Completion/Zsh/*/*' +functions='Completion/*comp* Completion/AIX/*/* Completion/BSD/*/* Completion/Base/*/* Completion/Cygwin/*/* Completion/Darwin/*/* Completion/Debian/*/* Completion/Linux/*/* Completion/Mandrake/*/* Completion/Redhat/*/* Completion/Solaris/*/* Completion/Unix/*/* Completion/X/*/* Completion/Zsh/*/*' moddeps="zsh/zle" --UugvWAfsgieZRqgk--