From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5669 invoked from network); 23 Jul 2003 19:58:06 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 23 Jul 2003 19:58:06 -0000 Received: (qmail 29646 invoked by alias); 23 Jul 2003 19:58:01 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18893 Received: (qmail 29636 invoked from network); 23 Jul 2003 19:58:01 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 23 Jul 2003 19:58:01 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.147.90.174] by sunsite.dk (MessageWall 1.0.8) with SMTP; 23 Jul 2003 19:57:58 -0000 Received: by baptport.math-info.univ-paris4.fr (Postfix, from userid 1000) id 85DD228F20; Wed, 23 Jul 2003 21:57:18 +0200 (CEST) Subject: some completion functions :) From: baptiste daroussin To: zsh-workers@sunsite.dk Content-Type: multipart/mixed; boundary="=-EOrnLmA+Yxxse0v4I8mZ" Message-Id: <1058990237.12981.5.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.0 Date: 23 Jul 2003 21:57:18 +0200 --=-EOrnLmA+Yxxse0v4I8mZ Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi, I've written some completion function for : rar, unrar (_rar) oggenc, ogginfo, oggdec, ogg123 (_vorbis) I've updated _links to work with links >= 2.X I've improved _pkgtool Sory, no path because I've overwritten the different scripts :( I've tested it under gentoo 1.4 with zsh 4.0.6 and slackware 9.1 with zsh 4.0.7 and zsh 4.1.1 Normaly all works :) -- baptiste daroussin --=-EOrnLmA+Yxxse0v4I8mZ Content-Disposition: attachment; filename=_links Content-Type: text/plain; name=_links; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: quoted-printable #compdef links local curcontext=3D"$curcontext" state line typeset -A opt_args _arguments -C \ '-async-dns[Asynchronous DNS resolver]:bool:(0 1)' \ '-max-connections[Maximum number of concurrent connections.]:max:' \ '-max-connections-to-host[Maximum number of concurrent connection to= a given host.]:max:' \ '-retries[Number of retries.]:retries:' \ '-receive-timeout[Timeout on receive.]:secs:' \ '-unrestartable-receive-timeout[Timeout on non restartable connectio= ns.]:secs:' \ '-format-cache-size[Number of formatted document pages cached.]:page= s:' \ '-memory-cache-size[Cache memory in bytes.]:kilobytes:' \ '-image-cache-size[Cache memory in bytes.]:kilobytes:'\ '-http-proxy[Host and port number of the HTTP proxy, or blank.]:host= port:_hosts' \ '-ftp-proxy[Host and port number of the FTP proxy, or blank.]:hostpo= rt:_hosts' \ '-download-dir[Default download directory.]:_files -/' \ '-assume-codepage[Use the given codepage when the webpage did not sp= ecify its codepage.]:codepage:' \ '-anonymous[Restrict links so that it can run on an anonymous accoun= t.]' \ '-no-connect[Runs links as a separate instance - instead of connecti= ng to existing instance.]' \ '-version[Prints the version number.]' \ '-help[Display help]' \ '-g[Run in graphics mode]'\ '-driver[Graphics driver to use.]:drivers:(x svgalib fb pmshell athe= os)'\ '-mode[Graphics mode.]:mode:'\ ':url:->html' && return 0 case "$state" in html) _files -g '*.html' || _urls ;; esac --=-EOrnLmA+Yxxse0v4I8mZ 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:{compadd "$expl[@]" /dev/*}' ) _arguments -s \ $flags[@]=20 ;; esac } _slackware_pkg "$@" --=-EOrnLmA+Yxxse0v4I8mZ Content-Disposition: attachment; filename=_rar Content-Type: text/plain; name=_rar; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: quoted-printable #compdef rar unrar _rar(){ case $service in rar) _arguments -s \ '*::rar command:_rar_command'=20 ;; unrar) _arguments -s \ '*::unrar command:_unrar_command' ;; esac } _compression_level() { compression_level=3D _tags compression_level && { compadd "$@" -k compression_level || compa= dd "$@" ${(kv)=3Dcompression_level} } } _dico_size() { dico_size=3D(64 128 256 512 1024 2048 4096 a b c d e f g) _tags dico_size && { compadd "$@" -k dico_size || compadd "$@" ${(kv)= =3Ddico_size} } } _unrar_command () { cmd=3D(e l lt p t v vt x) if (( CURRENT =3D=3D 1 ));then _tags cmd && { compadd "$@" -k cmd || compadd "$@" ${(kv)=3Dcmd} } else _arguments -C \ '-ad[Append archive name to destination path]'\ '-ap[Set path inside archive]'\ '-av\-[Disable authenticity verification check]'\ '-c\-[Disable comments show]'\ '-cfg\-[Disable read configuration]'\ '-cl\-[Convert names to lower case]'\ '-cu[Convert names to upper case]'\ '-dh[Open shared files]'\ '-ep[Exclude paths from name]'\ '-f[Freshen files]'\ '-idp[Disable percentage display]'\ '-ierr[Send all messages to stderr]'\ '-inul[Disable all messages]'\ '-kb[Keep broken extracted files]'\ '-o\+[Overwrite existing files]'\ '-o\-[Do not overwrite existing files]'\ '-ow[Save or restore file owner and group]'\ '-p\-[Do not query password]'\ '-r[Recurse subdirectorie]'\ '-ta[Process files modified after in YYYYMMDDHHMMSS form= at]'\ '-tb[Process files modified before in YYYYMMDDHHMMSS for= mat]'\ '-tn[Process files newer than