From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3746 invoked from network); 4 Jul 2003 13:40:57 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 4 Jul 2003 13:40:57 -0000 Received: (qmail 21468 invoked by alias); 4 Jul 2003 13:40:52 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18807 Received: (qmail 21461 invoked from network); 4 Jul 2003 13:40:52 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 4 Jul 2003 13:40:52 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.48.200.215] by sunsite.dk (MessageWall 1.0.8) with SMTP; 4 Jul 2003 13:40:51 -0000 Received: by baptport.math-info.univ-paris5.fr (Postfix, from userid 1000) id 57F8A494CD; Fri, 4 Jul 2003 15:40:07 +0200 (CEST) Subject: Completion function for ZSH, how to submit it ?? From: baptiste daroussin To: zsh-workers@sunsite.dk Content-Type: multipart/mixed; boundary="=-p7sVcEI/6+UIyW7s4g5/" Message-Id: <1057326006.1514.18.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.0 Date: 04 Jul 2003 15:40:06 +0200 --=-p7sVcEI/6+UIyW7s4g5/ Content-Type: text/plain Content-Transfer-Encoding: 7bit I send it once again (no reply before), My function works, it is very usefull (at least for me :) ), I'd like to see it integrated in ZSH. How to do so? (tested on slakware 9.0 with zsh 4.0.6) --old message-- Here is my first completion function :) It's a completion function for pkgtool, the slackware package management system. I don't know the process to submit it to the ZSH developper (perhaps here, wrong ??) So here is may function : _pkgtool (it works fine for me) I will create other function as soon as I'll have time, I find it it quite easy to do (for simple one) and it change the life :) -- baptiste daroussin --=-p7sVcEI/6+UIyW7s4g5/ Content-Disposition: attachment; filename=_pkgtool Content-Type: text/plain; name=_pkgtool; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: quoted-printable #compdef installpkg upgradepkg removepkg pkgtool explodepkg makepkg=20 _slackware_pkg() { local flags case "$service" in installpkg) flags=3D( '-warn[warn if files will be overwritten, but do not install]' '-root=3D[install someplace else, like /mnt]:Root directory:_path_fil= es -/' '-infobox[use dialog to draw an info box]' '-menu[confirm package installation with a menu]' '-ask[used with menu mode: always ask if a package should be installe= d regardless of what the package'\''s priority is]' '-priority[provide a priority for the entire package list to use inst= ead of the priority in the tagfile]:Priority list:(ADD REC OPT SKP)' '-tagfile[specify a different file to use for package priorities. Th= e default is "tagfile" in the package'\''s directory]:Tagfile:_files -/' ) _arguments -s \ $flags[@] \ '*:Slackware packages:_files -g \*.tgz' ;; removepkg) flags=3D( '-warn[Generate a report to the standard output about which file= s and directories would be removed, but does not actually remove the packag= e.]' '-preserve[If specified, the complete package subtree is reconstructe= d in /tmp/preserved_packages/packagename.]' '-copy[Construct a copy of the package under /tmp/preserved_packages/= packagename, but don'\''t remove it. (same effect as -warn -preserve)]' '-keep[Save the intermediate files created by removepkg (delete= _list, required_files, uniq_list, del_link_list, required_links, requir= ed_list). Mostly useful for debugging purposes.]' ) _arguments -s \ $flags[@] \ '*:Package name:_files -W /var/log/packages/ -/' ;; upgradepkg) flags=3D( '--install-new[the behavior is modified to install new packages in ad= dition to upgrading existing ones.]' '--reinstall[upgrade all packages even if the same version is already= installed.]' '--verbose[Show all the gory details of the upgrade.]' ) _arguments -s \ $flags[@] \ '*:Slackware packages:_files -g \*.tgz' ;; =20 explodepkg) _arguments -s \ '*:Slackware packages:_files -g \*.tgz' ;; makepkg) flags=3D( '(--linkadd -l)'{--linkadd,-l}'[moves symlinks into doinst.sh: recomm= ended]:Answer:(y n)' '(--chown -c)'{--chown,-c}'[resets all permissions to root:root 755 -= not generally recommended]:Answer:(y n)' ) _arguments -s \ $flags[@]=20 ;; pkgtool) flags=3D( '-sets[Install the disk sets A, B, C. Seperate the disk set names by '\= ''#'\'' symbols.]' '-source_mounted[When this flag is present, pkgtool will not attempt to= unmount and remount the source device with each disk.]' '-ignore_tagfile[When this flag is present, pkgtool will install every = *.tgz package encountered no matter what the tagfiles say.]' '-tagfile[This flag is used to specify from the command line which tagf= ile should be used for the installation.]:Tagfile:_files -/' '-source_dir[Used when installing multiple packages from disk sets. Th= is is the directory in which the subdirectories for each disk are found.]:S= ource directory:_path_files -/' '-target_dir[The directory where the target root directory is located. = This is '/' when installing on the hard drive, or typically '\''/mnt'\'' w= hen installing from an install disk.]:Target directory:_path_files -W -/' '-source_device[The source device to install from. This is not used if = you'\''ve provided the -source_mounted flag. It'\''s usually used when inst= alling from floppy.]:Source device:_files -/' ) _arguments -s \ $flags[@]=20 ;; esac } _slackware_pkg "$@" --=-p7sVcEI/6+UIyW7s4g5/--