?PNG
IHDR ? f ??C1 sRGB ?? gAMA ?a pHYs ? ??od GIDATx^LeY?a?("Bh?_????q5k?*:t0A-o??]VkJM??f?8\k2ll1]q????T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/user1137782/www/china1.by/classwithtostring.php on line 86
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
PK [_O O functions/_opennu W+A #compdef open
_open_absolute_application_path() {
local expl curcontext
zstyle -T ":completion:${curcontext}:files" prefix-needed && \
[[ "$PREFIX" != [/~]* && compstate[nmatches] -ne 0 ]] && return 1
_wanted files expl 'application file' _path_files -P "$PREFIX[1]" -W /
}
_open() {
local curcontext="$curcontext" state line expl
_arguments -C \
'-a[specify application]: :->open_mac_applications' \
'-e[open with TextEdit]' \
'-f[reads input from standard input and opens with TextEdit]' \
'*: :->open_files'
case "$state" in
open_mac_applications)
_alternative \
"commands: :_mac_applications" \
"files:: _open_absolute_application_path"
;;
open_files)
local app
if [[ -n "$words[(r)-a]" ]]; then
app="${(Q)words[words[(i)-a] + 1]}"
elif [[ -n "$words[(r)-e]" || -n "$words[(r)-f]" ]]; then
app="Text Edit"
fi
if [[ -n "$app" ]]; then
_wanted files expl "file for $app" _mac_files_for_application "$app"
else
_webbrowser
fi
;;
esac
}
_open "$@"
PK [
D
functions/_rinu W+A #compdef ri
local curcontext="$curcontext" state line ret=1
typeset -A opt_args
_arguments \
'(- *)'{-h,--help}'[print help information and exit]' \
'(- *)'{-v,--version}'[display the version of ri]' \
'*'{-d,--doc-dir}'[directory to search for documentation]:ri doc directory:_files -/' \
'(-f --fmt --format)'{-f,--fmt,--format}'[format to use when displaying output]:output format:(ansi bs html plain simple)' \
'(-T --no-pager)'{-T,--no-pager}'[send output directly to stdout]' \
'(-i, --interactive)'{-i,--interactive}'[interactive mode]' \
'--list-doc-dirs[list the directories from which ri will source documentation]' \
'(-w --width)'{-w,--width}'[set the width of the output]:output width:' \
'--no-standard-docs[do not include documentation from the Ruby standard library, site_lib, installed gems, or ~/.rdoc]' \
'(--no-use-cache --use-cache)--'{no-,}'use-cache[whether or not to use ri'\''s cache]' \
'(--no-system --system)--'{no-,}'system[include documentation from Ruby'\''s standard library]' \
'(--no-site --site)--'{no-,}'site[include documentation from libraries installed in site_lib]' \
'(--no-gems --gems)--'{no-,}'gems[include documentation from RubyGems]' \
'(--no-home --home)--'{no-,}'home[include documentation stored in ~/.rdoc]' \
'*:ri name:->ri-name' && ret=0
if [[ "$state" = ri-name ]]; then
local -a ri_dirs ri_names ri_wants ri_names
local class_dir esc_name dir curtag tag descr expl
ret=1
if "ruby${words[1]#ri}" -rrdoc/ri/ri_options.rb -e 1 >/dev/null 2>&1; then
# Old-style Ruby 1.8.x RI
ri_dirs=( ${(f)"$(_call_program ri-names "ruby${words[1]#ri}" -rrdoc/ri/ri_options -e '"o = RI::Options.instance; o.parse(ARGV); o.path.each { |p| puts p }"' -- ${(kv)opt_args[(I)-d|--doc-dir|--(system|site|gems|home)]})"} )
else
# New-style Ruby 1.9+ RI
ri_dirs=( ${(f)"$(_call_program ri-names "$words[1]" ${(kv)opt_args[(I)-d|--doc-dir|--((no-|)(system|site|gems|home)|standard-docs)]} --list-doc-dirs -f plain -T)"} )
fi
if compset -P '?*(::|\#|.)'; then
class_dir=${IPREFIX//(::|\#|.)/\/}
#else
# :
fi
esc_name=${${(Q)PREFIX}//(#b)([^A-Za-z0-9_])/$(printf %%%x ${(qq)match[1]})}
case "$IPREFIX" in
(*::) ri_wants=( 'classes:class names' 'class-methods:class methods' );;
(*\#) ri_wants=( 'instance-methods:instance methods' );;
(*.) ri_wants=( 'class-methods:class methods' 'instance-methods:instance methods' );;
(*) ri_wants=( 'classes:class names' )
esac
for curtag in $ri_wants; do
tag=${curtag%%:*}
descr=${curtag#*:}
_tags "$tag"
while _tags; do
while _next_label "$tag" expl "$descr"; do
ri_wants=()
case "$tag" in
(classes)
for dir in $ri_dirs[@]; do
ri_wants+=( $dir/$class_dir*(-/:t) )
done
;;
(class-methods)
for dir in $ri_dirs[@]; do
fnames=( $dir/$class_dir*-c.yaml(-.:t) )
ri_wants+=( ${${fnames%-c.yaml}//(#b)%(??)/$(print "\\x$match[1]")} )
done
;;
(instance-methods)
for dir in $ri_dirs[@]; do
fnames=( $dir/$class_dir*-i.yaml(-.:t) )
ri_wants+=( ${${fnames%-i.yaml}//(#b)%(??)/$(print "\\x$match[1]")} )
done
;;
esac
ri_names=( ${(Q)ri_wants} )
compadd -S '' -d ri_names -a "$expl[@]" ri_wants && ret=0
done
(( ret )) || break
done
done
fi
return ret
PK [] ] functions/_iwconfignu W+A #compdef iwconfig
local curcontext="$curcontext" state line expl ret=1
_arguments -C \
'(1 * -)--help[display help information]' \
'(1 * -)--version[display version information]' \
'1:network interface:_net_interfaces' \
'*:parameter:->parameters' && ret=0
if [[ -n "$state" ]]; then
local -a arg
case $words[CURRENT-1] in
essid) _wanted -x names expl 'network name' compadd off any on ;;
nwid|domain) _message -e ids 'network id' ;;
freq|channel) _message -e channels 'channel or frequency' ;;
sens) _message -e levels 'signal level' ;;
mode)
_wanted modes expl 'operating mode' compadd \
Ad-Hoc Managed Master Repeater Secondary Monitor Auto
;;
ap) _message -e access-points 'access point' ;;
nick*) _message -e names 'nickname' ;;
rate|bit*) _message -e bit-rates 'bit rate' ;;
rts*|frag*) _message -e sizes 'size' ;;
key|enc*) _message -e keys 'key' ;;
power)
arg=(
\*{min,max}'[modifier]'
'*off[disable power management]'
'*on[enable power management]'
'*all[receive all packets]'
'unicast[receive unicast packets only]'
'multicast[receive multicast and broadcast packets only]'
)
;&
min|max)
_values -S ' ' -w 'parameter' \
'period[set the period between wake ups]' \
'timeout[set timeout before sleep]' \
$arg[@] && ret=0
;;
period|timeout) _message -e timeouts 'timeout' ;;
txpower) _message -e power 'transmit power' ;;
retry) _message -e retries 'retries' ;;
(modu) _wanted -x names expl 'modulation' compadd 11g CCK OFDMa auto ;;
*)
_values -S ' ' -w 'option' \
'essid[set the network name]' \
'(nwid domain)'{nwid,domain}'[set the network ID]' \
'(freq channel)'{freq,channel}'[set the operating frequency or channel]' \
'sens[set the sensitivity threhold]' \
'mode[set operating mode]' \
'ap[register with given access point]' \
'(nick nickname)'nick{,name}'[set the nickname]' \
'(rate bit)'{rate,bit}'[set the bitrate]' \
'rts[set packet size threshold for sending RTS]' \
'frag[set maximum packet fragment size]' \
\*{key,enc}'[add encryption key]' \
'*power[manipulate power management scheme parameters]' \
'txpower[set transmit power]' \
'retry[set number of retries]' \
'modu[force a specific set of modulations]' \
'commit[apply changes imediately]' && ret=0
;;
esac
fi
return ret
PK [6@? functions/_darcsnu W+A #compdef darcs
## Darcs completion snippet for zsh.
##
## Copyright (C) 2009 Nicolas Pouillard
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
if (($CURRENT == 2)); then
# We're completing the first word after "darcs" -- the command.
_wanted command expl 'darcs command' \
compadd -- $( darcs --commands )
else
case "${words[$CURRENT]}"; in
# If it looks like an URL...
ht*|ft*)
_arguments '*:URL:_urls'
;;
# If it looks like an explicit path...
/*|./*|\~*|../*)
_arguments '*:file:_files'
;;
# Otherwise, let's ask darcs for all possible options
*)
_wanted args expl 'arg for darcs command' \
compadd -- $( darcs ${words[2]} --list-option )
;;
esac
fi
PK [{7 functions/_pbuildernu W+A #compdef pbuilder
local expl
if (( CURRENT == 2 )); then
_wanted tag expl 'pbuilder command' \
compadd create update build execute clean login dumpconfig debuild \
--create --update --build --execute --clean --login --dumpconfig --debuild
else
compset -n 1
_arguments \
'--basetgz:location:_files -g "*.tgz"' \
'--buildplace:location:_files -/' \
'--buildresult:location:_files -/' \
'--mirror:URL:_urls' \
'--othermirror:URL:_urls' \
'--distribution:suite:(breezy dapper edgy etch feisty gutsy hardy hoary intrepid jaunty karmic lenny lucid potato sarge sid squeeze warty woody' \
'--architecture:architecture:(alpha amd64 armel hppa hurd-i386 i386 ia64 m68k mips mipsel powerpc s390 sparc)' \
'--components:component:(main contrib non-free)' \
'--override-config' \
'--hookdir:location:_files -/' \
'--debbuildopts:dpkg-buildpackage options:' \
'--logfile:log file:_files' \
'--binary-arch' \
'--bindmounts:bind mountpoints:_files -/' \
'--debootstrapopts:debootstrap options:' \
'--debootstrap:debootstrap implementation:(debootstrap cdebootstrap)' \
'--save-after-login' \
'--save-after-exec' \
'--autocleanaptcache' \
'*:source package:_files -g "*.dsc"'
fi
PK [z5o o functions/_debsignnu W+A #compdef debsign
_arguments \
'-r[copy .changes file from remote host]: :_user_at_host' \
'-p[program with which to sign]:program name' \
'-m[maintainer]:maintainer name and email address' \
'-e[maintainer]:maintainer name and email address' \
'-k[key ID to use for signing]:keyid' \
'-s[argument style for signing program]:gpg or pgp' \
'-S[look for source-only .changes file]' \
'-a[architecture]:Debian architecture' \
'-t[GNU system type]:GNU system type' \
'--help[display help information]' \
'--version[display version information]' \
'*:changes or dsc file:_files -g "*.(changes|dsc)(-.)"'
PK [R, ,
functions/_ddnu W+A #compdef dd
_values -w 'option' \
'if[specify input file]:input file:_tilde_files' \
'of[specify output file]:output file:_tilde_files' \
'(bs)ibs[input block size]:block size (bytes)' \
'(bs)obs[output block size]:block size (bytes)' \
'(ibs obs)bs[block size]:block size (bytes)' \
'cbs[conversion buffer size]:buffer size (bytes)' \
'skip[input blocks initially skipped]:blocks' \
'seek[output blocks initially skipped]:blocks' \
'files[specify number of input files to copy and concatenate]:number of files' \
'count[number of input blocks to copy]:blocks' \
'conv[specify conversions to apply]:conversion:_values -s , conversion
"(ebcdic ibm)ascii" "(ascii ibm)ebcdic" "(ascii ebcdic)ibm"
"(unblock)block" "(block)unblock"
"(ucase)lcase" "(lcase)ucase" swab noerror sync'
PK [
* functions/_fakerootnu W+A #compdef fakeroot
_arguments \
'(-l --lib)'{-l,--lib}'[specify alternate wrapper library]:wrapper library:_files' \
'--faked[specify alternate faked binary]:fake binary:_command_names -e' \
'-s[save the fakeroot environment on exit]:save file:_files' \
'-i[load a previously saved environment]:file:_files' \
'(-u --unknown-is-real)'{-u,--unknown-is-real}'[use real ownership of previously unknown files]' \
'(-):command name:_command_names -e' \
'*::arguments:_normal'
PK [3mR
R
functions/_make-kpkgnu W+A #compdef make-kpkg
local context state line
typeset -A opt_args
_arguments \
'--help[display help message]' \
'--revision[change Debian revision number]:number:' \
'--append-to-version[specify additional kernel sub-version]:suffix:' \
'--added-modules[specify add-on modules]:module list:->addedmodules' \
'--added-patches[specify additional patches]:patches list' \
'--arch[specify architecture for cross-compilation]:architecture' \
'--cross-compile[specify target string]:target' \
'--subarch[specify subarchitecture]:subarchitecture:' \
'--arch-in-name[include architecture in kernel image name]' \
'--pgpsign[sign changes file]:name' \
'--config[specify configuration target]:target:(oldconfig config menuconfig xconfig old menu x)' \
'--targets[list known targets]' \
'--noexec[pass -n option to make]' \
'--verbose[show top level make commands]' \
'--initrd[create image suitable for initrd]' \
'(--bzimage)--zimage[make zImage instead of bzImage]' \
'(--zimage)--bzimage[make bzImage instead of zImage]' \
'--mkimage[command that produces an initrd image given a directory]:command:' \
'--rootcmd[specify command for gaining root access]:root command:(sudo fakeroot)' \
'--stem:package name stem:(kernel linux)' \
'--us[unsigned source]' \
'--uc[unsigned changelog]' \
'*:target:(( \
clean\:"clean the kernel source directory" \
buildpackage\:"runs the targets clean and binary" \
binary\:"all kernel packages" \
binary-indep\:"arch independent packages" \
binary-arch\:"arch dependent packages" \
kernel-source\:"package of the kernel sources" \
kernel-headers\:"package of the header files included in the kernel" \
kernel-manual\:"package of the manual pages included in the kernel" \
kernel-doc\:"package of teh documentation included in the kernel" \
kernel-image\:"package of the kernel image" \
build\:"compiles the kernel" \
modules\:"build all add-on modules" \
modules-config\:"configure all add-on modules" \
modules-image\:"build all add-on modules, but wirhou source and diff files" \
modules-clean\:"clean add-on modules" \
configure\:"configure the kernel" \
debian\:"creates the debian/ directory" \
libc-kheaders\:"create the kernel headers package needed by libc" \
))' && return 0
case "$state" in
(addedmodules)
compset -P '*,'
_alternative \
'moddirs:module dirs:_files -/ -S ,' \
'modules:loc module dirs:_files -/ -W ${MODULE_LOC:-/usr/src/modules} -S ,'
;;
esac
PK [sF functions/insert-filesnu W+A # insert-files() {
# Autoload this function, run `zle -N ' and bind
# to a key.
# This function allows you type a file pattern, and see the results of the
# expansion at each step. When you hit return, they will be inserted into
# the command line.
emulate -L zsh
setopt nobadpattern
local key str files
files=( *(N) )
if (( $#files )); then
zle -R "files: ${str}_" "$files[@]"
else
zle -R "files: ${str}_ (failed)"
fi
read -k key
while [[ '#key' -ne '#\\r' && '#key' -ne '#\\n' &&
'#key' -ne '#\\C-g' ]]; do
if [[ '#key' -eq '#\\C-h' || '#key' -eq '#\\C-?' ]]; then
[[ -n "$str" ]] && str="$str[1,-2]"
else
str="$str$key"
fi
eval "files=( \${~str}*(N) )"
if (( $#files )); then
zle -R "files: ${str}_" "$files[@]"
else
zle -R "files: ${str}_ (failed)"
fi
read -k key
done
zle -Rc
if [[ '#key' -ne '#\\C-g' && $#files -gt 0 ]]; then
[[ "$LBUFFER[-1]" = ' ' ]] || files=('' "$files[@]")
LBUFFER="$LBUFFER$files "
fi
# }
PK [2 2 functions/_cpionu W+A #compdef cpio
local args ig curcontext="$curcontext" state line
local expl ret
local fmts='(bar bin odc newc crc tar ustar hpbin hpodc)'
_pick_variant -r ig gnu=GNU unix --version
if (( CURRENT == 2 )); then
# Complete arguments
args=('-o[create archive]' '-i[extract from archive]'
'-p[run as filter on directory tree]')
[[ $ig = gnu ]] && args=($args '--create[create archive]'
'--extract[extract from archive]'
'--pass-through[run as filter on directory tree]'
'--help[show help text]' '--version[show version information]')
else
if [[ -n ${words[(r)(-o*|-[^-]*o*|--create)]} ]]; then
# Options for creating archive
if [[ $ig = gnu ]]; then
args=(
'--file=:archive file:->afile'
"--format=:format type:$fmts"
'--message=:message at end of volume:'
'--null' '--reset-access-time'
'--verbose' '--dot' '--append'
'--block-size=:block size in 512 byte units:'
'--dereference'
'--io-size=:block size in bytes'
'--quiet' '--force-local' '--help' '--version')
fi
args=($args
'-A[append files to archive]'
'-B[block size 5120 bytes with special file]'
'-C[set block size per record]:block size in bytes:(8192)'
'-F[set archive file to use]:archive file:->afile'
'(-H)-c[read/write header in ASCII]'
"(-c)-H[set format type for archive header]:$fmts"
'-L[follow symbolic links]'
'-M[print message at end of volume]:message to print:'
'-O[set output archive file]:output archive file:_files'
)
elif [[ -n ${words[(r)(-i*|-[^-]*i*|--extract)]} ]]; then
if [[ $ig = gnu ]]; then
args=('--file=:archive file:->afile'
"--format=:format type:$fmts"
'--make-directories' '--nonmatching'
'--preserve-modification-time' '--numeric'
'--rename' '--list' '--swap-bytes' '--swap-halfwords'
'--dot' '--unconditional' '--verbose'
'--block-size=:block size in 512 byte units:'
'--swap-halfwords'
'--io-size=:block size in bytes:'
'--pattern-file=:file with list of patterns:_files'
'--owner=:user (and group) for files:->user' '--no-preserve-owner'
'--message=:message at end of volume:'
'--force-local'
'--no-absolute-filenames' '--sparse' '--only-verify-crc'
'--quiet' '--help' '--version')
fi
args=($args
'-b[reverse bytes in word]'
'-B[block size 5120 bytes with special file]'
'-d[create directories as needed]'
'-C[set block size per record]:block size in bytes:(8192)'
'-E[read filenames from file]:file name for list of files:_files'
'-f[only copy files not matching patterns]'
'-F[set archive file to use]:archive file:->afile'
'(-H)-c[read/write header in ASCII]'
"(-c)-H[set format type for archive header]:$fmts"
'-I[set input archive file]:input archive file:_files'
'-m[preserve file modification times]'
'-M[print message at end of volume]:message to print:'
'-n[show UID and GID numerically]'
'-r[interactively rename files]'
'-R[set user and group for files]:user (and group) for files:->user'
'-s[swap bytes within each halfword]'
'-S[swap bytes within each word]'
'-t[print a table of contents]'
'*:pattern to extract'
)
elif [[ -n ${words[(r)(-p*|-[^-]*p*|--pass-through)]} ]]; then
if [[ $ig = gnu ]]; then
args=('--null' '--reset-access-time' '--make-directories'
'--link' '--quiet' '--preserve-modification-time'
'--unconditional' '--verbose' '--dot' '--dereference'
'--owner=:user (and group) for files:->user'
'--no-preserve-owner' '--sparse' '--help' '--version')
fi
args=($args
'-d[create directories as needed]'
'-l[link files instead of copying]'
'-L[follow symbolic links]'
'-m[preserve file modification times]'
'-R[set user and group for files]:user (and group) for files:->user'
'*:destination directory:_files -/'
)
else
return 1
fi
args=($args
'-a[reset access time of input files]'
)
fi
ret=1
_arguments -C -s "$args[@]" && ret=0
if [[ $state = afile ]]; then
if compset -P '*:'; then
# TODO: doesn't need to be rsh.
_wanted files expl 'remote files' \
compadd $(rsh ${words[CURRENT]%:*} echo ${words[CURRENT]#*:}\*) && ret=0
elif compset -P '*@'; then
_wanted hosts expl 'remote host name' _hosts && ret=0
else
_alternative \
'files:: _files' \
'hosts:remote host name:_hosts -S:' \
'users:user name:_users -qS@' && ret=0
fi
elif [[ $state = user ]]; then
if compset -P '*[:.]'; then
_groups
else
local suf=.
[[ $OSTYPE = (solaris|hpux)* ]] && suf=:
compset -S '.*' && unset suf
_users -S "$suf" -q
fi
fi
return ret
PK [G functions/_xargsnu W+A #compdef xargs
_arguments \
'(-t)-p[prompt user for each command]' \
'(-p)-t[verbose - echo each command]' \
'-x[exit if max size exceeded]' \
-{e-,E}':end-of-file string:' \
'(-x -I)-i-:replacement string for lines:' \
'(-x -i)-I:replacement string for lines:' \
'(-n -L -x)-l-:number of input lines:' \
'(-n -l)-L:number of input lines:' \
'(-l -L)-n-:maximum number of arguments:' \
'-s-:maximum command line length:' \
'(-):command: _command_names -e' \
'*::args: _normal'
PK [F>i functions/_lspvnu W+A #compdef lspv
_arguments -C -s \
'(-p -M)-l[list logical volumes on physical volume]' \
'(-l -M)-p[list partitions on physical volume]' \
'(-l -p)-M[list mapping of physical and logical partition numbers]' \
'-n[specify physical volume to access variable descriptor from]:physical volume:_physical_volumes' \
'-v[specify volume group id to access info based on]:volume group id' \
'1:physical volume:_physical_volumes'
PK [K functions/_normalnu W+A #compdef -command-line-
local _comp_command1 _comp_command2 _comp_command skip
if [[ "$1" = -s ]]; then
skip=(-s)
else
skip=()
_compskip=''
fi
# Check for a history reference to complete modifiers.
# $PREFIX has a quoted form of the !, so we can't test that
# (it might the start of a real argument), but words has the
# raw McCoy.
if [[ -o BANG_HIST &&
( ( $words[CURRENT] = \!*: && -z $compstate[quote] ) ||
( $words[CURRENT] = \"\!*: && $compstate[all_quotes] = \" ) ) ]]; then
# This looks like a real history expansion; in that case
# we'd better put the !'s back the way pfalstad intended.
PREFIX=${PREFIX//\\!/!}
compset -P '*:'
_history_modifiers h
return
fi
# Completing in command position?
if [[ CURRENT -eq 1 ]]; then
curcontext="${curcontext%:*:*}:-command-:"
comp="$_comps[-command-]"
[[ -n "$comp" ]] && eval "$comp" && ret=0
return ret
fi
_set_command
_dispatch "$skip[@]" "$_comp_command" \
"$_comp_command1" "$_comp_command2" -default-
PK [w functions/_lastnu W+A #compdef last lastb
_arguments -s \
'-a[display hostname in last column]' \
'-n[number]:number' \
'-[number]:number' \
'-f[filename]:filename:_files' \
'-R[suppress display of hostname field]' \
'-d[translate IP to hostname]' \
'-i[display IP]' \
'-o[read old-format wtmp]' \
'-x[display shutdown/runlevel entries]' \
'-h[hostname]:host:_hosts' \
'-s[report duration in seconds]' \
'-t[tty]:tty' \
'-w[widen duration field]' \
'*:user:_users'
PK [tY Y functions/VCS_INFO_detect_tlanu W+A ## vim:ft=zsh
## gnu arch support by: Frank Terbeck
## Distributed under the same BSD-ish license as zsh itself.
setopt localoptions NO_shwordsplit
[[ $1 == '--flavours' ]] && return 1
VCS_INFO_check_com ${vcs_comm[cmd]} || return 1
vcs_comm[basedir]="$(${vcs_comm[cmd]} tree-root 2> /dev/null)" && return 0
return 1
PK [Q functions/_gphoto2nu W+A #compdef gphoto2
_arguments -s \
'--debug[turn on debugging]' \
'(-q --quiet)'{-q,--quiet}'[quiet output]' \
'(-v --version)'{-v,--version}'[display version and exit]' \
'(-h --help)'{-h,--help}'[display a short usage message]' \
'--list-cameras[list supported camera models]' \
'--list-ports[list supported port devices]' \
'--stdout[send file to stdout]' \
'--stdout-size[print filesize before data]' \
'--auto-detect[list auto-detected cameras]' \
'--port[specify port device]:port' \
'--speed[specify serial transfer speed]:speed' \
'--camera[specify camera model]:camera model' \
'--filename[specify pattern to save file as]:pattern' \
'--usbid[override USB IDs (expert only)]:usbid' \
'(-a --abilities)'{-a,--abilities}'[display camera abilities]' \
'(-f --folder)'{-f,--folder}'[specify camera folder]:folder' \
'(-R --recurse --no-recurse)'{-R,--recurse}'[recursion (default for download)]' \
'(-R --recurse)--no-recurse[no recursion (default for deletion)]' \
'(-l --list-folders)'{-l,--list-folders}'[list folders in folder]' \
'(-L --list-files)'{-L,--list-files}'[list files in folder]' \
'(-m --mkdir)'{-m,--mkdir}'[create a directory]:directory' \
'(-r --rmdir)'{-r,--rmdir}'[remove a directory]:directory' \
'(-n --num-files)'{-n,--num-files}'[sisplay number of files]' \
'(-p --get-file)'{-p,--get-file}'[get files given in range]:range' \
'(-P --get-all-files)'{-P,--get-all-files}'[get all files from folder]' \
'(-t --get-thumbnail)'{-t,--get-thumbnail}'[get thumbnails given in range]:range' \
'(-T --get-all-thumbnails)'{-T,--get-all-thumbnails}'[get all thumbnails from folder]' \
'(-r --get-raw-data)'{-r,--get-raw-data}'[get raw data given in range]:range' \
'--get-all-raw-data[get all raw data from folder]' \
'--get-audio-data[get audio data given in range]:range' \
'--get-all-audio-data[get all audio data from folder]' \
'--delete-files[delete files given in range]:range' \
'--delete-all-files[delete all files in folder]' \
'(-u --upload-file)'{-u,--upload-file}'[upload a file to camera]:file:_files' \
'--capture-preview[capture a quick preview]' \
'--capture-image[capture an image]' \
'--capture-movie[capture a movie]' \
'--capture-sound[capture an audio clip]' \
'--show-info[show info about given range]:range' \
'--summary[summary of camera status]' \
'--manual[camera driver manual]' \
'--about[show information about the camera driver]' \
'--shell[start the gphoto2 shell]'
PK [m˾]% % functions/_zmvnu W+A #compdef zmv zln zcp
_arguments -s -S -A '-*' \
'(-C -L -s -p)-M[force mv]' \
'(-M -L -s -p)-C[force cp]' \
'(-M -C -p)-L[force ln]' \
'-f[force overwriting of destination files]' \
'-i[interactive: prompt for each operation]' \
'-n[no execution: just print what would happen]' \
'-Q[force bare glob qualifiers on]' \
'(-C -M)-s[symbolic, passed down to ln]' \
'-v[verbose: print line as it is executed]' \
'-o[specify options to pass to underlying command]: opt string' \
'(-M -C -L -s)-p+[specify program to run instead of cp, ln or mv]:program:_command_names -e' \
'(-W)-w[implicitly add parenthesis to wildcards in the pattern]' \
'(-w)-W[like -w, but turn wildcards in replacement patterns into references]' \
'1:source pattern:_files' \
'2:destination pattern:_files'
PK [1Dx x functions/down-case-word-matchnu W+A emulate -L zsh
setopt extendedglob
autoload -Uz match-words-by-style
local curcontext=":zle:$WIDGET" word
local -a matched_words
integer count=${NUMERIC:-1}
while (( count-- > 0 )); do
match-words-by-style
word=${(j..)matched_words[4,5]}
if [[ -n word ]]; then
LBUFFER+=${(L)word}
RBUFFER=${(j..)matched_words[6,7]}
else
return 1
fi
done
return 0
PK [AI I functions/_todo.shnu W+A #compdef todo.sh
# See http://todotxt.com for todo.sh.
#
# Featurettes:
# - "replace" will complete the original text for editing
# - completing priorities will cycle through A to Z (even without
# menu completion)
# - list and listall will complete + and @ from
# values in existing entries
# - will complete after + and @ if typed in message text
setopt localoptions braceccl
local expl curcontext="$curcontext" state line pri nextstate item
local -a cmdlist itemlist match mbegin mend
integer NORMARG
_arguments -s -n : \
'-d[alternate config file]:config file:_files' \
'-f[force, no confirmation]' \
'-h[display help]' \
'-p[plain mode, no colours]' \
'-v[verbose mode, confirmation messages]' \
'-V[display version etc.]' \
'1:command:->commands' \
'*:arguments:->arguments' && return 0
local projmsg="context or project"
local txtmsg="text with contexts or projects"
# Skip "command" as command prefix if words after
if [[ $words[NORMARG] == command && NORMARG -lt CURRENT ]]; then
(( NORMARG++ ))
fi
case $state in
(commands)
cmdlist=(
"add:add TODO ITEM to todo.txt."
"addm:add TODO ITEMs, one per line, to todo.txt."
"addto:add text to file (not item)"
"append:adds to item on line NUMBER the text TEXT."
"archive:moves done items from todo.txt to done.txt."
"command:run internal commands only"
"del:deletes the item on line NUMBER in todo.txt."
"depri:remove prioritization from item"
"do:marks item on line NUMBER as done in todo.txt."
"help:display help"
"list:displays all todo items containing TERM(s), sorted by priority."
"listall:displays items including done ones containing TERM(s)"
"listcon:list all contexts"
"listfile:display all files in .todo directory"
"listpri:displays all items prioritized at PRIORITY."
"move:move item between files"
"prepend:adds to the beginning of the item on line NUMBER text TEXT."
"pri:adds or replace in NUMBER the priority PRIORITY (upper case letter)."
"replace:replace in NUMBER the TEXT."
"remdup:remove exact duplicates from todo.txt."
"report:adds the number of open and done items to report.txt."
)
_describe -t todo-commands 'todo.sh command' cmdlist
;;
(arguments)
case $words[NORMARG] in
(append|command|del|move|mv|prepend|pri|replace|rm)
if (( NORMARG == CURRENT - 1 )); then
nextstate=item
else
case $words[NORMARG] in
(pri)
nextstate=pri
;;
(append|prepend)
nextstate=proj
;;
(move|mv)
nextstate=file
;;
(replace)
item=${words[CURRENT-1]##0##}
compadd -Q -- "${(qq)$(todo.sh -p list "^[ 0]*$item " | sed '/^--/,$d')##<-> (\([A-Z]\) |)}"
;;
esac
fi
;;
(depri|do|dp)
nextstate=item
;;
(a|add|addm|list|ls|listall|lsa)
nextstate=proj
;;
(addto)
if (( NORMARG == CURRENT - 1 )); then
nextstate=file
else
nexstate=proj
fi
;;
(listfile|lf)
if (( NORMARG == CURRENT -1 )); then
nextstate=file
else
_message "Term to search file for"
fi
;;
(listpri|lsp)
nextstate=pri
;;
(*)
return 1
;;
esac
;;
esac
case $nextstate in
(file)
_path_files -W ~/.todo
;;
(item)
itemlist=(${${(M)${(f)"$(todo.sh -p list | sed '/^--/,$d')"}##<-> *}/(#b)(<->) (*)/${match[1]}:${match[2]}})
_describe -t todo-items 'todo item' itemlist
;;
(pri)
if [[ $words[CURRENT] = (|[A-Z]) ]]; then
if [[ $words[CURRENT] = (|Z) ]]; then
pri=A
else
# cycle priority
pri=$words[CURRENT]
pri=${(#)$(( #pri + 1 ))}
fi
_wanted priority expl 'priority' compadd -U -S '' -- $pri
else
_wanted priority expl 'priority' compadd {A-Z}
fi
;;
(proj)
# This completes stuff beginning with + (projects) or @ (contexts);
# these are todo.sh conventions.
if [[ ! -prefix + && ! -prefix @ ]]; then
projmsg=$txtmsg
fi
# In case there are quotes, ignore anything up to whitespace before
# the + or @ (which may not even be there yet).
compset -P '*[[:space:]]'
_wanted search expl $projmsg \
compadd $(todo.sh lsprj) $(todo.sh lsc)
;;
esac
PK [ㄟ functions/prompt_clint_setupnu W+A # clint prompt theme
prompt_clint_help () {
cat <<'EOF'
prompt clint [ [ [ [ []]]]]
defaults are red, cyan, green, yellow, and white, respectively.
EOF
}
prompt_clint_setup () {
local -a pcc
local -A pc
local p_date p_tty p_plat p_ver p_userpwd p_apm p_shlvlhist p_rc p_end p_win
autoload -Uz vcs_info
pcc[1]=${1:-${${SSH_CLIENT+'yellow'}:-'red'}}
pcc[2]=${2:-'cyan'}
pcc[3]=${3:-'green'}
pcc[4]=${4:-'yellow'}
pcc[5]=${5:-'white'}
pc['\[']="%F{$pcc[1]}["
pc['\]']="%F{$pcc[1]}]"
pc['<']="%F{$pcc[1]}<"
pc['>']="%F{$pcc[1]}>"
pc['\(']="%F{$pcc[1]}("
pc['\)']="%F{$pcc[1]})"
p_date="$pc['\[']%F{$pcc[2]}%D{%a %y/%m/%d %R %Z}$pc['\]']"
p_tty="$pc['\[']%F{$pcc[3]}%l$pc['\]']"
p_plat="$pc['\[']%F{$pcc[2]}${MACHTYPE}/${OSTYPE}/$(uname -r)$pc['\]']"
p_ver="$pc['\[']%F{$pcc[2]}${ZSH_VERSION}$pc['\]']"
[[ -n "$WINDOW" ]] && p_win="$pc['\(']%F{$pcc[4]}$WINDOW$pc['\)']"
p_userpwd="$pc['<']%F{$pcc[3]}%n@%m$p_win%F{$pcc[5]}:%F{$pcc[4]}%~$pc['>']"
p_vcs="%(2v.%U%2v%u.)"
p_shlvlhist="%fzsh%(2L./$SHLVL.) %B%h%b "
p_rc="%(?..[%?%1v] )"
p_end="%f%B%#%b "
zle_highlight[(r)default:*]=default:$pcc[2]
prompt="$p_date$p_tty$p_plat$p_ver
$p_userpwd
$p_shlvlhist$p_rc$p_vcs$p_end"
PS2='%(4_.\.)%3_> %E'
add-zsh-hook precmd prompt_clint_precmd
}
prompt_clint_precmd () {
setopt noxtrace noksharrays localoptions
local exitstatus=$?
local git_dir git_ref
psvar=()
[[ $exitstatus -ge 128 ]] && psvar[1]=" $signals[$exitstatus-127]" ||
psvar[1]=""
[[ -o interactive ]] && jobs -l
vcs_info
[[ -n $vcs_info_msg_0_ ]] && psvar[2]="$vcs_info_msg_0_"
}
prompt_clint_setup "$@"
PK [V{C C functions/_vorbisnu W+A #compdef oggenc ogg123 ogginfo oggdec
local expl ret=1
case $service in
oggenc)
_arguments -s \
'(- *)'{-h,--help}'[show help]' \
'(- *)'{-v,--version}'[display version information]' \
'(-r --raw)'{-r,--raw}'[assume input data is raw, little-endian with no header information]' \
'(-B --raw-bits)'{-B+,--raw-bits=}'[set raw mode input sample size in bits]:sample size:(8 16)' \
'(-C --raw-chan)'{-C+,--raw-chan=}'[set raw mode input number of channels]:number of channels' \
'(-R --raw-rate)'{-R+,--raw-rate=}'[set raw mode input sample rate]:sample rate:(44100 48000)' \
'--raw-endianness[set raw mode endianness]:endianness:((0\:big\ endian 1\:little\ endian))' \
'(-Q --quiet)'{-Q,--quiet}'[quiet mode]' \
'(-b --bitrate)'{-b+,--bitrate=}'[set encoding to the bitrate closest to that specified]:bitrate (kb/s)' \
'(-m --min-bitrate)'{-m+,--min-bitrate=}'[set minimum bitrate]:bitrate (kb/s)' \
'(-M --max-bitrate)'{-M+,--max-bitrate=}'[set maximum bitrate]:bitrate (kb/s)' \
'--managed[turn off the normal VBR encoding]' \
'(-q --quality)'{-q+,--quality=}'[set encoding quality]:quality:(0 1 2 3 4 5 6 7 8 9 10)' \
'--resample[resample input to the given sample rate before encoding]:sample rate (Hz)' \
'--downmix[down mix input from stereo to mono]' \
'--advanced-encode-option:option name:_values option "bitrate_average_window[set the managed bitrate window]\:number (seconds)" "lowpass_frequency[set the lowpass frequency]\:frequency (kHz)"' \
'(-s --serial)'{-s+,--serial=}'[force a specific serial number in the output stream]' \
"--discard-comments[don't copy comments from FLAC file to output Ogg Vorbis file]" \
'(-o --output)'{-o+,--output=}'[write the Ogg Vorbis stream to output_file]:files:->oggfiles' \
'(-n --names)'{-n+,--names=}'[specify pattern for producing filenames]:string' \
'(-X --name-remove)'{-X+,--name-remove=}'[remove specified characters from output filenames]:characters' \
'(-P --name-replace)'{-P+,--name-replace=}'[specify replacement characters for those removed]:characters' \
'(-c --comment)'{-c+,--comment}'[add the string comment as an extra comment]:comment' \
'(-a --artist)'{-a+,--artist}'[set the artist comment field in the comments to artist]:artist' \
'(-G --genre)'{-G+,--genre}'[set the genre comment field in the comments to genre]:genre' \
'(-d --date)'{-d+,--date}'[set the date comment field to the given value]:date' \
'(-N --tracknum)'{-N+,--tracknum}'[set the track number comment field to the given value]:track number' \
'(-t --title)'{-t+,--title}'[set the track title comment field to title]:title' \
'(-l --album)'{-l+,--album}'[set the album comment field to album]' \
'*:input file:_files -g "(#i)*.(flac|wav|aiff)(-.)"' && ret=0
;;
ogg123)
_arguments -C -s \
'(- *)'{-h,--help}'[show help]' \
'(- *)'{-V,--version}'[display version information]' \
\*{-d+,--device}'[output device]:device:((null\:discard\ all\ data oss\:open\ sound\ system sun\:sun\ audio alsa\:advanced\ linux\ sound\ architecture irix\:IRIX\ audio arts\:aRts\ sound\ daemon esd\:enlightened\ sound\ daemon au\:sun\ audio\ file raw\:raw\ sample wav\:wav\ file))' \
\*{-f+,--files=}'[output filename for a previously specified file device]:output filename:_files -g "(#i)*.(wav|au|raw)(-.)"' \
'(-k --skip)'{-k+,--skip}"[skip the first 'n' seconds (or to hh:mm:ss)]:seconds" \
'(-K --end)'{-K+,--end}"[end at 'n' seconds (or hh:mm:ss)]:seconds" \
'(-b --buffer)'{-b+,--buffer}'[size of input buffer]:kilobytes' \
'(-p --prebuffer)'{-p+,--prebuffer}'[prebuffer percentage]:percent' \
'(-q --quiet)*'{-v,--verbose}'[increase verbosity]' \
'(-q --quiet -v --verbose)'{--quiet,-q}'[quiet mode]' \
'(-x --nth)'{-x+,--nth}'[block decode intervall]:number' \
'(-y --ntimes)'{-y+,--ntimes}'[block repeat count]:number' \
'(-z --shuffle)'{-z,--shuffle}'[shuffle play]' \
'(-l --delay)'{-l+,--delay=}'[set delay between two SIGINTs to quit]:delay (ms)' \
'(-@ --list)'{-@+,--list}'[play all of the files from a playlist]:playlist:_files' \
'--audio-buffer=[size of output audio buffer]:kilobytes' \
\*{-o,--device-option=}'[assign device option values]:device option:->devopts' \
'*:sound file or directory:_files -g "(#i)*.(ogg|flac|spx)"' && ret=0
;;
ogginfo)
_arguments \
'(- *)-h[show a help and usage message]' \
'(-)*-q[quiet mode]' \
'(-)-v[verbose mode]' \
'*:ogg vorbis file:_files -g "(#i)*.ogg(-.)"' && ret=0
;;
oggdec)
_arguments -s \
'(-Q --quiet)'{-Q,--quiet}'[quiet mode]' \
'(- *)'{-h,--help}'[print help information]' \
'(- *)'{-v,--version}'[display version information]' \
'(-b --bits)'{-b+,--bits=}'[bits per sample]:bits per sample:(8 16)' \
'(-e --endian)'{-e+,--endian=}'[set endianness for 16-bit output]:endianness:((0\:\(default\)\ little-endian\ \(Intel\ byte\ order\) 1\:big-endian\ \(sane\ byte\ order\)))' \
'(-R --raw)'{-R+,--raw=}'[output in raw format]' \
'(-o --output)'{-o+,--output=}'[write output to specified filename]:output filename:_files' \
'(-s --sign)'{-s+,--sign=}'[set signedness for output]:signedness:((0\:unsigned 1\:signed\ \(default\)))' \
'*:ogg vorbis file:_files -g "(#i)*.ogg(-.)"' && ret=0
;;
esac
if [[ $state = devopts ]]; then
if compset -p '*:'; then
_message -e value value
else
_wanted devopts expl 'device option' \
compadd -S : - dsp dev card buf_size host byteorder && return
fi
fi
return ret
PK [ϸeO functions/_dpatch-edit-patchnu W+A #compdef dpatch-edit-patch
_arguments \
'(-d --description)'{-d,--description=}'[description for the new patch, if applicable]' \
'(-o --outdir)'{-o,--outdir=}'[output directory for patches]:patch output directory:_files -/' \
'(-s --sourcedir)'{-s,--sourcedir=}'[source directory]:source directory:_files -/' \
'(-t --tmpdir)'{-t,--tmpdir=}'[temporary directory]:temporary directory:_files -/' \
'(-p --stampdir)'{-p,--stampdir=}'[stamp directory]:stamp directory:_files -/' \
'(-e --exclude)'{-e,--exclude}'[list of files and directories to be excluded]:excluded files and directories:_files' \
'(-b --debianonly)'{-b,--debianonly=}'[unpack .orig.tar.gz before invoking the shell]:path to .orig.tar.gz:_files' \
'(-k --keeptemp)'{-k,--keeptemp}'[keep working source tree after exit]' \
'(-c --clean)'{-c,--clean}'[clean the current directory]' \
'(-l --shell)'{-l,--shell=}'[shell to be invoked]:shell:' \
'(-P --origtargzpath)'{-P,--origtargzpath=}'[colon-separated list of paths containing upstream tarballs, use with -b]:path to upstream tarballs:_dir_list' \
'(-h --help)'{-h,--help}'[help text]' \
'1:patch name:_files -W $PWD/debian/patches -g \*.dpatch\(-.\:r\)' \
'2:base patch name:_files -W $PWD/debian/patches -g \*.dpatch\(-.\:r\)'
PK [FM functions/_lsvgnu W+A #compdef lsvg
_arguments -C -s \
'(-i -l -M -p)-o[lists only active volume groups]' \
'(-i -l -M -p)-n[specify physical volume to access variable descriptor from]:physical volume:_physical_volumes' \
'(-o -n)-i[reads volume group names from standard input]' \
'(-o -n -M -p)-l[list logical volumes in volume group]' \
'(-o -n -l -p)-M[list mapping of physical and logical partition numbers]' \
'(-o -n -l -M)-p[list physical volumes used by volume group]' \
'*:volume group:_volume_groups'
PK [EG G functions/_mathnu W+A #compdef -math- let
if [[ "$PREFIX" = *[^a-zA-Z0-9_]* ]]; then
IPREFIX="$IPREFIX${PREFIX%%[a-zA-Z0-9_]#}"
PREFIX="${PREFIX##*[^a-zA-Z0-9_]}"
fi
if [[ "$SUFFIX" = *[^a-zA-Z0-9_]* ]]; then
ISUFFIX="${SUFFIX##[a-zA-Z0-9_]#}$ISUFFIX"
SUFFIX="${SUFFIX%%[^a-zA-Z0-9_]*}"
fi
_parameters -g '(integer|float)*' || _parameters
PK [_R R functions/tcp_renamenu W+A # Rename session OLD (defaults to current session) to session NEW.
# Does not handle aliases; use tcp_alias for all alias redefinitions.
local old new
if (( $# == 1 )); then
old=$TCP_SESS
new=$1
elif (( $# == 2 )); then
old=$1
new=$2
else
print "Usage: $0 OLD NEW" >&2
return 1
fi
local fd=$tcp_by_name[$old]
if [[ -z $fd ]]; then
print "No such session: $old" >&2
return 1
fi
if [[ -n $tcp_by_name[$new] ]]; then
print "Session $new already exists." >&2
return 1
fi
# Can't rename an alias
if [[ $tcp_by_fd[$fd] != $old ]]; then
print "Use tcp_alias to redefine an alias." >&2
return 1
fi
tcp_by_name[$new]=$fd
unset "tcp_by_name[$old]"
tcp_by_fd[$fd]=$new
[[ $TCP_SESS = $old ]] && TCP_SESS=$new
if zmodload -i zsh/parameter; then
if (( ${+functions[tcp_on_rename]} )); then
tcp_on_rename $new $fd $old
fi
fi
PK [yV V functions/_arraysnu W+A #compdef shift
local expl
_wanted arrays expl array _parameters "$@" - -g '*array*'
PK [a a functions/_pkg_instancenu W+A #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
PK [DUF F functions/VCS_INFO_detect_bzrnu W+A ## vim:ft=zsh
## bazaar support by: Frank Terbeck
## Distributed under the same BSD-ish license as zsh itself.
setopt localoptions NO_shwordsplit
[[ $1 == '--flavours' ]] && return 1
VCS_INFO_check_com bzr || return 1
vcs_comm[detect_need_file]=branch/format
VCS_INFO_bydir_detect '.bzr'
return $?
PK [z0Pi i functions/url-quote-magicnu W+A # Functions to make it easier to type URLs as command line arguments. As
# you type, the input character is analyzed and, if it may need quoting,
# the current word is checked for a URI scheme. If one is found and the
# current word is not already in quotes, a backslash is inserted before
# the input character.
# Setup:
# autoload -Uz url-quote-magic
# zle -N self-insert url-quote-magic
# A number of zstyles may be set to control the quoting behavior.
#
# url-metas
# This style is looked up in the context :url-quote-magic:SCHEME (where
# SCHEME is that of the current URL, e.g. "ftp"). The value is a string
# listing the characters to be treated as globbing metacharacters when
# appearing in a URL using that scheme. The default is to quote all zsh
# extended globbing characters, excluding '<' and '>' but including
# braces (as in brace expansion). See also url-seps.
#
# url-seps
# Like url-metas, but lists characters that should be considered command
# separators, redirections, history references, etc. The default is to
# quote the standard set of shell separators, excluding those that
# overlap with the extended globbing characters, but including '<' and
# '>' and the first character of $histchars.
#
# url-globbers
# This style is looked up in the context :url-quote-magic. The values
# form a list of command names that are expected to do their own globbing
# on the URL string. This implies that they are aliased to use the
# "noglob" modifier. When the first word on the line matches one of the
# values AND the URL refers to a local file (see url-local-schema), only
# the url-seps characters are quoted; the url-metas are left alone,
# allowing them to affect command-line parsing, completion, etc. The
# default values are a literal "noglob" plus (when the zsh/parameter
# module is available) any commands aliased to the helper function
# "urlglobber" or its alias "globurl".
#
# url-local-schema
# This style is always looked up in the context :urlglobber, even though
# it is used by both url-quote-magic and urlglobber. The values form
# a list of URI schema that should be treated as referring to local files
# by their real local path names, as opposed to files which are specified
# relative to a web-server-defined document root. The defaults are "ftp"
# and "file".
#
# url-other-schema
# Like url-local-schema, but lists all other URI schema upon which
# urlglobber and url-quote-magic should act. If the URI on the
# command line does not have a scheme appearing either in this list or in
# url-local-schema, it is not magically quoted. The default values are
# "http", "https", and "ftp". When a scheme appears both here and in
# url-local-schema, it is quoted differently depending on whether the
# command name appears in url-globbers.
# TODO:
# Add a style for "document root" for globbing local URLs.
# Turn this on at colon, and off again at space or accept.
# Use compsys for nested quoting analysis and command parsing.
# Establish default values for styles, but only if not already set
zstyle -m ':url-quote-magic:\*' url-metas '*' ||
zstyle ':url-quote-magic:*' url-metas '*?[]^(|)~#{}='
zstyle -m ':url-quote-magic:\*' url-seps '*' ||
zstyle -e ':url-quote-magic:*' url-seps 'reply=(";&<>${histchars[1]}")'
zstyle -m :url-quote-magic url-globbers '*' ||
zstyle -e :url-quote-magic url-globbers \
'zmodload -i zsh/parameter;
reply=( noglob
${(k)galiases[(R)(* |)(noglob|urlglobber|globurl) *]:-}
${(k)aliases[(R)(* |)(noglob|urlglobber|globurl) *]:-} )'
zstyle -m ':urlglobber' url-local-schema '*' ||
zstyle ':urlglobber' url-local-schema ftp file
zstyle -m ':urlglobber' url-other-schema '*' ||
zstyle ':urlglobber' url-other-schema http https ftp
# Define the "urlglobber" helper function and shorthand "globurl" alias
function urlglobber {
local -a args globbed localschema otherschema
local arg command="$1"
shift
zstyle -s :urlglobber url-local-schema localschema '|'
zstyle -s :urlglobber url-other-schema otherschema '|'
for arg
do
case "${arg}" in
((${~localschema}):/(|/localhost)/*)
globbed=( ${~${arg##ftp://(localhost|)}} )
args[$#args+1]=( "${(M)arg##(${~localchema})://(localhost|)}${(@)^globbed}" )
;;
((${~otherschema}):*) args[${#args}+1]="$arg";;
(*) args[${#args}+1]=( ${~arg} );;
esac
done
"$command" "${(@)args}"
}
alias globurl='noglob urlglobber '
# Finally, define (and execute if necessary) the function we really want
function url-quote-magic {
setopt localoptions noksharrays extendedglob
local qkey="${(q)KEYS}"
if [[ "$KEYS" != "$qkey" ]]
then
local lbuf="$LBUFFER$qkey"
if [[ "${(Q)LBUFFER}$KEYS" == "${(Q)lbuf}" ]]
then
local -a words
words=("${(@Q)${(z)lbuf}}")
local urlseps urlmetas urlglobbers localschema otherschema
if [[ "$words[-1]" == (#b)([^:]##):* ]]
then
zstyle -s ":url-quote-magic:$match[1]" url-seps urlseps ''
zstyle -s ":url-quote-magic:$match[1]" url-metas urlmetas ''
fi
zstyle -s :url-quote-magic url-globbers urlglobbers '|'
zstyle -s :urlglobber url-other-schema otherschema '|'
if [[ "$words[1]" == ${~urlglobbers} ]]
then
zstyle -s :urlglobber url-local-schema localschema '|'
else
localschema=' '
fi
case "$words[-1]" in
(*[\'\"]*) ;;
((${~localschema}):/(|/localhost)/*)
[[ "$urlseps" == *"$KEYS"* ]] &&
LBUFFER="$LBUFFER\\" ;;
((${~otherschema}):*)
[[ "$urlseps$urlmetas" == *"$KEYS"* ]] &&
LBUFFER="$LBUFFER\\" ;;
esac
fi
fi
zle .self-insert
}
# Handle zsh autoloading conventions
[[ -o kshautoload ]] || url-quote-magic "$@"
PK [9 functions/_iftopnu W+A #compdef iftop
_interfaces () {
_wanted interfaces expl 'network interface' \
_net_interfaces
_values "Pseudo-device that captures on all interfaces" "any"
}
_arguments \
'(-h -n -N -p -b -B -P -i -f -F -c)'-h'[print a summary of usage]' \
-n"[don't do hostname lookups]" \
-N"[don't resolve port number to service names]" \
-p'[run in promiscuous mode]' \
-P'[turn on port display]' \
-b"[don't display bar graphs of traffic]" \
-B'[display bandwidth rates in bytes/sec rather than bits/sec]' \
-i'[interface]:network interface:_interfaces' \
-f'[filter]:BPF filter' \
-F'[net/mask]:network/mask' \
-c'[config file]:config file:_files'
PK [Qe e functions/_mysqldiffnu W+A #compdef mysqldiff
local curcontext="$curcontext" state line expl
typeset -A opt_args
_mysqldiff () {
_arguments -s \
{-h{,1,2},--host{,1,2}=}':server hostname:_mysql_hosts' \
{-p{,1,2},--password{,1,2}=}':server password: ' \
{-u{,1,2},--user{,1,2}=}':server username:_mysql_users' \
{-s{,1,2},--socket{,1,2}=}':server socket:_directories' \
{-d,--debug=}':debugging level (default 1):(1 2 3 4 5 6 7 8)' \
{-i,--tolerant}':ignore DEFAULT and formatting changes: ' \
{-k,--keep-old-tables}":don\'t output DROP TABLE commands: " \
{-n,--no-old-defs}"[don't output old defs as comments]" \
{-o,--only-both}'[only output changes for tables in both databases]' \
{-t,--table-re}':restrict comparisons to tables matching a regexp: ' \
{-A,--apply}':interactively patch database1 to match database2: ' \
{-\?,--help}'[display usage]' \
{1,2}':MySQL database:_mysql_db_or_file'
}
_mysql_db_or_file () {
_alternative \
'databases:MySQL databases:_mysql_databases' \
'files:MySQL database definition files:_files -g "*.(my|)sql(-.)"'
}
_mysql_utils
_mysqldiff "$@"
PK [*+l functions/_axi-cachenu W+A #compdef axi-cache
local expl
_arguments \
'--version[version]' \
'(-h --help)'{-h,--help}'[help]' \
'(-s --sort)'{-s,--sort=}':sort value:('${(j: :)${${(M)${(f)"$(args' && return 0
if (( CURRENT == 2 )); then
_wanted tag expl 'axi-cache commands' \
compadd help search more last show again
else
case "$words[2]" in
(search|show|again)
_wanted tag expl 'terms/query' \
compadd -- $($service $words[2] --tabcomplete=plain -- $words[CURRENT])
;;
(more|last)
_wanted tag expl 'count' \
compadd -- 1 2 3 4 5 6 7 8 9 0
;;
(*)
_files
;;
esac
fi
PK [l}7%\ \ functions/_mplayernu W+A #compdef mplayer gmplayer
local suf ret=1 curcontext="$curcontext"
local -a vals state line expl
_x_arguments -C -s \
'!-abs:buffer size' \
'-ac[force usage of a specific audio codec]:audio codec attachment:->audio-codecs' \
'-af[activate audio filters]:filter' -af-adv:option \
'-afm[force usage of a specific audio codec family]:audio codec family:->audio-codec-families' \
'-aid:audio channel id' \
'-alang[select the DVD audio language]:country code' \
'(-nosound)-ao[specify audio driver]:audio-driver attachment:->audio-drivers' \
'-aofile:file:_files' \
'(-nosound)*-aop[specify audio output filter]:audio output filter:->audio-plugins' \
'-aspect:ratio' \
'-audiofile:audio file:_files -g "(#i)*.(wav|mp3|ogg)(-.)"' \
-autoq:quality -autosync:factor \
-bandwidth:bandwidth\ value -benchmark -bpp:depth \
'(-nocache)-cache:cache size (kb)' \
'-cdda:audio CD options:(spped paranoia generic-dev sector-size overlap toc-bias toc-offset skip noskip)' \
'-cdrom-device:cdrom device:_files -g "*(-%b)"' \
'-channels:playback channels:((2\:stereo 4\:surround 6\:full\ 5.1))' \
'-chapter:chapter' -contract:value \
'-csslib:libcss.so location:_files' \
-cuefile -delay:delay -demuxer:number -dfbopts:value \
'(-nodouble)-double[enable double buffering]' \
'-dr[enable direct rendering]' \
-dxr2:option -dumpaudio -dumpstream -dumpvideo \
'-dumpfile:output file:_files' \
-dumpmicrodvdsub -dumpmpsub -dumpsrtsub -dumpjacosub -dumpsami -dumpsub \
'-dvd:title id' '-dvdauth:DVD device' \
'-dvd-device:dvd device:_files -g "*(-%b)"' \
'-dvdangle:angle id' '-dvdkey:key' \
'-edl:edl file:_files' '-edlout:edl file:_files' -enqueue \
'-fbmode:video mode' '-fbmodeconfig:config file:_files' \
'-fb[specify framebuffer device to use]:device:_files -g "*(-%b)"' \
'-ffactor:factor:(0 0.75 1 10)' \
-flip '-font:font.desc file:_files' -forceidx -forcexv -format:format \
'-fps[force frame rate]:frame-rate' \
'-framedrop' \
'-frames:frame number' \
'-fs[fullscreen]' -fstype:type \
-gui -{,gui}'wid:X window:_x_window' \
{-h,-help,--help}'[display help info]' \
-hardframedrop \-hr-mp3-seek \
'-hue:video signal hue adjustment' \
'(-rootwin)-icelayer:icewm layer:((0\:desktop 2\:below 4\:normal 6\:ontop 8\:dock 10\:abovedock 12\:menu))' \
'(-use-stdin)-idx[rebuild index of the avi]' \
'-ifo:ifo file:_files' '-include:config-file:_files' \
'-input:command:(conf ar-delay ar-rate keylist cmdlist js-dev file)' \
'-jpeg:option' -lavdopts:option \
'-lircconf:lirc config file:_files' '-loop:repetitions' \
'-mc[specify max sync correction]:max sync correction' \
'-mf[specify option when decoding multiple PNG or JPEG files]:option' \
'-mixer:mixer device:_files -g "*(-%b)"' \
'-monitoraspect:ratio' -monitor_dotclock -monitor_{h,v}freq:frequency \
'-ni[force usage of non-interlaced avi parser]' \
-noaspect -noautosub -overlapsub -nooverlapsub -nowaveheader \
'(-cache)-nocache' -nobps \
'(-double)-nodouble' -nodshow -noextbased -noframedrop \
-nograbpointer -nokeepaspect -noslices -nojoystick -nolirc -nortc \
'(-ao -aop)-nosound' \
'-osdlevel:osd-level:((0\:subtitles\ only 1\:volume\ +\ seek 2\:volume\ +\ seek\ +\ timer\ +\ percentage 3\:volume\ +\ seek\ +\ timer\ +\ percentage\ +\ total\ time))' \
-panscan:value \
'-passwd[specify password for http authentication]:password' \
'-playlist:file:_files' \
'-pp[apply postprocess filter]:filter attachment' -pphelp \
-quiet -really-quiet -rootwin \
-rawaudio:option -rawvideo:option \
'-rtsp-stream-over-tcp' -saturation:value \
'-sb[seek to byte position]:byte' \
-screen{w,h}:pixels \
'-sdp[input file is a SDP file]' -shuffle \
'-skin[skin directory]:skin directory:_directories' \
-skipopening -slave \
'-sid[turn on DVD subtitles]:language id' \
'-speed[set playback speed rate]:playback speed rate' \
'-srate[specify frequency of audio playback]:frequency (Hz)' \
'-ss[seek to given time position]:position (hh:mm\[\:ss\])' \
'-sstep[specify time between displayed frames]:time (seconds)' \
-ssf:mode -stop_xscreensaver \
'-stereo:mode:((0\:stereo 1\:left\ channel 2\:right\ channel))' \
'-sub[use specified subtitle file]:subtitle file:_files' \
-subfps:rate -sub-bg-alpha:value -sub-bg-color:value -subcc -subcp:codepage -subdelay:seconds \
-subpos:vertical\ position -s{ub,pu}'align:alignment:((0\:top 1\:center 2\:bottom))' \
'-subfont-autoscale:mode:((0\:no\ autoscale 1\:proportional\ to\ height 2\:proportional\ to\ width 3\:proportional\ to\ diagonal))' \
-subfont-blur:radius -subfont-encoding:encoding -subfont-osd-scale:coefficient -subfont-outline:thickness -subfont-text-scale:coefficient \
-sub-no-text-pp -spuaa:mode -spugauss:gauss -sws:scalar\ type \
'-tv[TV grabbing]:option' \
-unicode -utf8 \
'-user[specify username for http authentication]' \
'(-idx)-use-stdin' \
'-vcd[play video cd track]:track' \
'-vc[force usage of a specific video codec]:video-codec attachment:->video-codecs' \
'-v[enable verbose output]' \
'*-vf[video output filters]:video output filters:->video-output-plugins' \
'-vfm[force usage of a specific video codec family]:video-codec-family:(1 2 3 4 5)' \
'-vid[select video channel]:video-channel' \
'-vm[try to change to a better video mode]' \
'-vo[specify video driver]:video-driver attachment:->video-drivers' \
'-vop[specify video output filters]:video output filters:->video-output-plugins' \
-vobsub:vobsub\ file -vobsubid:id -vsync \
'-x[scale image to x width if driver supports]:width' \
-xineramascreen:screen -xvidopts:option \
'-xy[scale image by factor if driver supports]:factor' \
'-y[scale image to y height if driver supports]:height' \
'-z[specify compression level for png output]:compression-level:((0\:no\ compression 1 2 3 4 5 6\:default\ compression 7 8 9\:max\ compression))' \
'-zoom[use software scaling, where available (use with -nofs)]' \
-zrbw -zrcrop -zrdev -zrfd -zrhelp -zrnorm -zrquality -zr{h,v}dec -zr{x,y}doff \
'(-use-stdin)*:video file:->mfiles'
case "$state" in
mfiles)
_tags files urls
while _tags; do
_requested files expl 'video file' _files -g \
"*.(#i)(asf|asx|avi|flac|flv|m1v|m2p|m2v|mjpg|mka|mkv|mov|mp3|mp4|mpe|mpeg|mpg|ogg|ogm|qt|rm|vob|wav|wma|wmv)(-.)" && ret=0
if _requested urls; then
while _next_label urls expl URL; do
_urls "$expl[@]" && ret=0
compadd -S '' "$expl[@]" {dvd,vcd,cdda,cddb,tv}:// && ret=0
done
fi
(( ret )) || return 0
done
;;
audio-codecs)
vals=( help ${${${(f)"$(_call_program audio-codecs $words[1] -ac help -quiet 2>/dev/null)"}[(r)ac:*,-1]}[2,-1]/ ##[^ ]# #[^ ]# #/:} )
_describe -t audio-codecs 'audio codec' vals && ret=0
;;
audio-drivers)
vals=( help ${${${(f)"$(_call_program audio-drivers mplayer -ao help 2>/dev/null)"}[(r) *,-1]#?}/ /:} )
_describe -t audio-drivers 'audio drivers' vals && ret=0
;;
audio-codec-families)
compset -P '*,'
compset -S ',*'
vals=( help ${${${(f)"$(_call_program audio-codec-families mplayer -afm help 2>/dev/null)"}[(r) [^:]#,-1]## ##}/ ##/:} )
_describe -t audio-codec-families 'audio drivers' vals && ret=0
;;
audio-plugins)
_values -s : 'audio output plugin' \
'list[specify list of plugins]:plugin:(resample surround format volume extrastereo volnorm delay)' \
'format[output format]:format' \
'fout[output frequency]:frequency (Hz)' \
'volume[volume level]:volume <0-255>' \
'mul[stereo coefficient]:coefficient' \
'softclip[compressor]' && ret=0
;;
video-codecs)
vals=( help ${${${(f)"$(_call_program audio-codecs $words[1] -vc help -quiet 2>/dev/null)"}[(r)vc:*,-1]}[2,-1]/ ##[^ ]# #[^ ]# #/:} )
_describe -t video-codecs 'video codec' vals && ret=0
;;
video-drivers)
vals=( help ${${${(f)"$(_call_program video-drivers mplayer -vo help 2>/dev/null)"}[(r) *,-1]#?}/ /:} )
_describe -t video-drivers 'video drivers' vals && ret=0
;;
video-output-plugins)
vals=( help ${${${${(f)"$(_call_program video-output-plugins mplayer -vop help 2>/dev/null)"}[(r) *,-1]}/ /}/ #: /:} )
_describe -t video-output-plugins 'video output plugin' vals && ret=0
;;
esac
return ret
PK [ functions/split-shell-argumentsnu W+A # Split a command line into shell arguments and whitespace in $reply.
# Odd elements (starting from 1) are whitespace, even elements
# are shell arguments (possibly quoted strings). Whitespace at
# start and end is always included in the array but may be an empty string.
# $REPLY holds NO_KSH_ARRAYS index of current word in $reply.
# $REPLY2 holds NO_KSH_ARRAYS index of current character in current word.
# Hence ${reply[$REPLY][$REPLY2]} is the character under the cursor.
#
# reply, REPLY, REPLY2 should therefore be local to the enclosing function.
emulate -L zsh
setopt extendedglob
local -a bufwords lbufwords
local word
integer pos=1 cpos=$((CURSOR+1)) opos iword ichar
bufwords=(${(z)BUFFER})
reply=()
while [[ ${BUFFER[pos]} = [[:space:]] ]]; do
(( pos++ ))
done
reply+=${BUFFER[1,pos-1]}
(( cpos < pos )) && (( iword = 1, ichar = cpos ))
for word in "${bufwords[@]}"; do
(( opos = pos ))
(( pos += ${#word} ))
reply+=("$word")
if (( iword == 0 && cpos < pos )); then
(( iword = ${#reply} ))
(( ichar = cpos - opos + 1 ))
fi
(( opos = pos ))
while [[ ${BUFFER[pos]} = [[:space:]] ]]; do
(( pos++ ))
done
reply+=("${BUFFER[opos,pos-1]}")
if (( iword == 0 && cpos < pos )); then
(( iword = ${#reply} ))
(( ichar = cpos - opos + 1 ))
fi
done
if (( iword == 0 )); then
# At the end of the line, so off the indexable positions
# (but still a valid cursor position).
(( REPLY = ${#reply} ))
(( REPLY2 = 1 ))
else
(( REPLY = iword ))
(( REPLY2 = ichar ))
fi
PK [:{E functions/_conditionnu W+A #compdef -condition-
local prev="$words[CURRENT-1]" ret=1
if [[ "$prev" = -o ]]; then
_tags -C -o options && _options
elif [[ "$prev" = -([a-hkprsuwxLOGSN]|[no]t|ef) ]]; then
_tags -C "$prev" files && _files
elif [[ "$prev" = -t ]]; then
_file_descriptors
else
if [[ "$PREFIX" = -* ]] ||
! zstyle -T ":completion:${curcontext}:options" prefix-needed; then
if [[ "$prev" = (\[\[|\|\||\&\&|\!|\() ]]; then
_describe -o 'condition code' \
'( -a:existing\ file
-b:block\ special\ file
-c:character\ special\ file
-d:directory
-e:existing\ file
-f:regular\ file
-g:setgid\ bit
-h:symbolic\ link
-k:sticky\ bit
-n:non-empty\ string
-o:option
-p:named\ pipe
-r:readable\ file
-s:non-empty\ file
-t:terminal\ file\ descriptor
-u:setuid\ bit
-w:writable\ file
-x:executable\ file
-z:empty\ string
-L:symbolic\ link
-O:own\ file
-G:group-owned\ file
-S:socket
-N:unread\ file)' && ret=0
else
_describe -o 'condition code' \
'( -nt:newer\ than
-ot:older\ than
-ef:same\ file
-eq:numerically\ equal
-ne:numerically\ not\ equal
-lt:numerically\ less\ than
-le:numerically\ less\ than\ or\ equal
-gt:numerically\ greater\ than
-ge:numerically\ greater\ than\ or\ equal)' && ret=0
fi
fi
_alternative 'files:: _files' 'parameters:: _parameters' && ret=0
return ret
fi
PK [rm m functions/_pfctlnu W+A #compdef pfctl
local pfctl_flush_modifiers pfctl_optimizer_level pfctl_show_modifiers pfctl_tables_command pfctl_debug_level
pfctl_flush_modifiers=(
'all:flush all'
'info:flush the filter information'
'nat:flush the NAT rules'
'osfp:flush the passive operating system fingerprints'
'queue:flush the queue rules'
'rules:flush the filter rules'
'state:flush the stable table'
'Sources:flush the source tracking table'
'Tables:flush the tables'
)
pfctl_show_modifiers=(
'nat:show the currently loaded NAT rules'
'queue:show the currently loaded queue rules'
'rules:show the currently loaded filter rules'
'Anchors:show the currently loaded anchors directly attached to the main ruleset'
'state:show the contents of the state table'
'Sources:show the contents of the source tracking table'
'info:show filter information'
'labels:show per-rule statistics of filter rules with labels'
'timeouts:show the current global timeouts'
'memory:show the current pool memory hard limits'
'Tables:show the list of tables'
'osfp:show the list of operating system fingerprints'
'Interfaces:show the list of interfaces and interface drivers available to PF'
'all:show all except for the lists of interfaces and operating system fingerprints'
)
pfctl_optimizer_level=(
'none:disable the ruleset optimizer'
'basic:enable basic ruleset optimizations'
'profile:enable basic ruleset optimizations with profiling'
)
pfctl_tables_command=(
'kill:kill a table'
'flush:flush all addresses of a table'
'add:add one or more addresses in a table'
'delete:delete one or more addresses from a table'
'expire:delete addresses which had their statistics cleared more than number seconds ago'
'replace:replace the addresses of the table'
'show:show the content (addresses) of a table'
'test:test if the given addresses match a table'
'zero:clear all the statistics of a table'
'load:load only the table definitions from pf.conf(5)'
)
pfctl_debug_level=(
"none:don\'t generate debug messages"
'urgent:generate debug messages only for serious errors'
'misc:generate debug messages for various errors'
'loud:generate debug messages for common conditions'
)
_iface() {
local pfctl_iface
pfctl_iface=($(pfctl -s Interfaces))
compadd $pfctl_iface
}
_tables() {
local pfctl_tables
pfctl_tables=($(pfctl -s Tables))
compadd $pfctl_tables
}
# TODO:
# Missing -a
#
_arguments -s \
'-F[flush the filter parameters specified by modifier]:modifier:(($pfctl_flush_modifiers))' \
'-A[load only the queue rules present in the rule file]' \
'-D[define macro to be set to value]:macro:' \
'-d[disable the packet filter]' \
'-e[enable the packet filter]' \
'-f[load the rules contained in a file]:configuration file:_files' \
'-g[include output helpful for debugging]' \
'-h[help]' \
'-i[restrict the operation to the given interface]:interface:_iface' \
'-K[kill all of the source tracking entries originating from the specified host or network]:host or network:_hosts' \
'-k[kill all of the state entries originating from the specified host or network]:host or network:_hosts' \
'-m[merge in explicitly given options]' \
'-N[load only the NAT rules present in the rule file]' \
'-n[do not actually load rules, just parse them]' \
'-O[load only the options present in the rule file]' \
'-o[control the ruleset optimizer]:level:(($pfctl_optimizer_level))' \
'-p[use the device file device instead of the default /dev/pf]:device:_files' \
'-q[only print errors and warnings]' \
'-R[load only the filter rules present in the rule file]' \
'-r[perform reverse DNS lookups on states when displaying them]' \
'-s[show the filter parameters specified by modifier]:modifier:(($pfctl_show_modifiers ))' \
'-T[specify the command to apply to the table]:command:(($pfctl_tables_command))' \
'-t[specify the name of the table]:table:_tables' \
'-v[produce more verbose output]' \
'-x[set the debug level]:debug level:(($pfctl_debug_level))' \
'-z[clear per-rule statistics]'
PK [65 functions/_urxvtnu W+A #compdef urxvt
_x_arguments \
-+{rv,ls,j,ptab,sb,sr,st,si,sk,sw,ip,ipf,ut,vb,tcw,insecure,uc,bc,pb,bl,ssc,ssr} \
'-tn:terminal type:' \
'-C[intercept console messages]' \
'-iconic[start iconic]' \
'-sbt[scroll bar thickness]:pixels:' \
'-tint[tint color]:color:_x_color' \
'-fade[make colors darker when losing focus]:percentage:' \
'-sh[shade background when tinting]:percentage:' \
'-bg:background color:_x_color' \
'-fg:foreground color:_x_color' \
'-cr:cursor color:_x_color' \
'-pr:pointer color:_x_color' \
'-pr2:pointer background color:_x_color' \
'-bd:border color:_x_color' \
'-pixmap:pixmap:_files' \
'-fn:normal font:_x_font' \
'-fb:bold font:_x_font' \
'-fi:italic font:_x_font' \
'-fbi:bold italic font:_x_font' \
'-im:input method:(SCIM)' \
'-pt:input style:(OverTheSpot OffTheSpot Root)' \
'-imlocale:locale input method:_locales' \
'-imfont:fontset for styles OverTheSpot and OffTheSpot:_x_font' \
'-name:client instance, icon, and title strings:' \
'-title:title name for window:' \
'-n:icon name for window:' \
'-sl:save lines:' \
'-embed:window id to embed terminal in:_x_window' \
'-pty-fd:file descriptor of pty to use:' \
'-w:external border in pixels:' \
'-b:internal border in pixels:' \
'-lsp:number of extra pixels between rows:' \
'-mod:meta modifier:_x_modifier' \
'-e:program: _command_names -e:*::program arguments: _normal' \
'-help[print help]' \
'--help[list long options]'
PK [@ functions/_retrieve_mac_appsnu W+A #autoload
# Find paths of applications and preserve them into _mac_apps.
# Used by _mac_applications and _mac_files_for_application.
_mac_apps_caching_policy () {
# Rebuild if cache is more than a day old
local -a oldp
oldp=( "$1"(Nmw+1) )
(( $#oldp ))
}
# _mac_apps_*_retrieve
#
# Get search applications from directories specified in app_dir_root.
# Paths to applications are stored in _mac_apps.
_mac_apps_spotlight_retrieve () {
typeset mdfind_query="kMDItemContentType == 'com.apple.application-*'"
for i in ${app_dir_root}; do
_mac_apps+=(${(f)"$(_call_program command \
mdfind -onlyin ${(q)i} ${(q)mdfind_query})"})
done
}
_mac_apps_old_retrieve () {
# Get directories which may contain applications
typeset -aU app_dir
if [[ -z "$app_dir" ]] && \
! zstyle -a ":completion:${curcontext}:commands" application-dir app_dir
then
typeset -a app_dir_stop_pattern
app_dir_stop_pattern=( "*.app" "contents#" "*data" "*plugins#" "*plug?ins#" "fonts#" "document[[:alpha:]]#" "*help" "resources#" "images#" "*configurations#" )
typeset app_dir_pattern
app_dir_pattern="(^(#i)(${(j/|/)app_dir_stop_pattern}))"
app_dir=( ${^app_dir_root}/(${~app_dir_pattern}/)#(N) )
fi
# Get application bundles
local -a app_result
if ! zstyle -t ":completion:${curcontext}:commands" ignore-bundle; then
app_result=( ${^app_dir}*/Contents/(MacOS|MacOSClassic)(N) )
_mac_apps+=( ${app_result[@]%/Contents/MacOS*} )
fi
# Get single file applications
if ! zstyle -t ":completion:${curcontext}:commands" ignore-single; then
autoload -Uz zargs
local app_cand nargs envvars
app_cand=( ${^app_dir}^*.[a-z]#/..namedfork/rsrc(.UrN,.RN^U) )
envvars="$(builtin typeset -x)"
nargs=$(( $(command sysctl -n kern.argmax) - $#envvars - 2048 ))
app_result="$(zargs --max-chars $nargs ${app_cand[@]} -- grep -l APPL)"
_mac_apps+=( ${${(f)app_result}%/..namedfork/rsrc} )
fi
}
_retrieve_mac_apps() {
local cache_policy
zstyle -s ":completion:*:*:$service:*" cache-policy cache_policy
if [[ -z "$cache_policy" ]]; then
zstyle ":completion:*:*:$service:*" cache-policy _mac_apps_caching_policy
fi
if ( (( ${#_mac_apps} == 0 )) || _cache_invalid Mac_applications ) \
&& ! _retrieve_cache Mac_applications; then
# Get application search method
typeset retrieve
if ! zstyle -s ":completion:*:*:$service:commands" search-method retrieve
then
if [[ -d /.Spotlight-V100 ]]; then
# / is indexed to use Spotlight
retrieve=_mac_apps_spotlight_retrieve
else
# Fall back to the old way
retrieve=_mac_apps_old_retrieve
fi
zstyle ":completion:*:*:$service:commands" search-method $retrieve
fi
# Get root directories to search applications
typeset -a app_dir_root
if ! zstyle -a ":completion:${curcontext}" application-path app_dir_root
then
if [[ $retrieve = _mac_apps_old_retrieve ]]; then
app_dir_root=( {,/Developer,/Network,"$HOME"}/{Applications*(N),Desktop} )
else
app_dir_root=( / )
fi
zstyle ":completion:*" application-path $app_dir_root
fi
typeset -g -Ua _mac_apps
$retrieve
_store_cache Mac_applications _mac_apps
fi
}
_retrieve_mac_apps "$@"
PK [F functions/VCS_INFO_bydir_detectnu W+A ## vim:ft=zsh
## Written by Frank Terbeck
## Distributed under the same BSD-ish license as zsh itself.
setopt localoptions NO_shwordsplit
local dirname=$1
local basedir="." realbasedir
realbasedir="$(VCS_INFO_realpath ${basedir})"
while [[ ${realbasedir} != '/' ]]; do
[[ -r ${realbasedir} ]] || return 1
if [[ -n ${vcs_comm[detect_need_file]} ]] ; then
[[ -d ${basedir}/${dirname} ]] && \
[[ -e ${basedir}/${dirname}/${vcs_comm[detect_need_file]} ]] && \
break
else
[[ -d ${basedir}/${dirname} ]] && break
fi
basedir=${basedir}/..
realbasedir="$(VCS_INFO_realpath ${basedir})"
done
[[ ${realbasedir} == "/" ]] && return 1
vcs_comm[basedir]=${realbasedir}
return 0
PK [Zƣ\ \ functions/_telnetnu W+A #compdef telnet
# Parameter used:
#
# telnet_hosts_ports_users
# The array that contains 3-tuples `host:port:user'.
local curcontext="$curcontext" state line expl ret=1
typeset -A opt_args
if (( ! $+_telnet_args )); then
local help="$(_call_program options 'telnet -\?' < /dev/null 2>&1)"
local -A optionmap
optionmap=(
'*\[-8\]*' '-8[allow 8-Bit data]'
'*\[-E\]*' '-E[disable an escape character]'
'*\[-K\]*' '-K[no automatic login]'
'*\[-L\]*' '-L[allow 8-Bit data on output]'
'*\[-N\]*' '-N[suppress reverse lookup]'
'*\[-S tos\]*' '-S+:IP type-of-service:'
'*\[-X atype\]*' '-X+:authentication type to disable:'
'*\[-a\]*' '-a[attempt automatic login]'
'*\[-c\]*' '-c[disable .telnetrc]'
'*\[-d\]*' '-d[debug mode]'
'*\[-e char\]*' '-e+[specify escape character]:escape character:'
'*\[-f/*' '-f'
'*/-F\]*' '-F'
'*\[-k realm\]*' '-k+:realm:'
'*\[-l user\]*' '-l+[specify user]:user:->users'
'*\[-n tracefile\]*' '-n+[specify tracefile]:tracefile:_files'
'*\[-r\]*' '-r[rlogin like user interface]'
'*\[-s src_addr\]*' '-s+[set source IP address]:src_addr:'
'*\[-x\]*' '-x'
'*\[-t transcom\]*' '-t+:transcom:'
'*\[-noasynch\]*' '-noasynch'
'*\[-noasyncnet\]*' '-noasyncnet'
'*\[-noasynctty\]*' '-noasynctty'
)
_telnet_args=($optionmap[(K)"$help"])
(( $#_telnet_args )) || _telnet_args=( '-l+[specify user]:user:->users' )
fi
_arguments -C -s \
"$_telnet_args[@]" \
':host:->hosts' \
':port:->ports' && ret=0
case "$state" in
hosts)
_wanted hosts expl host \
_combination -s '[@:]' '' users-hosts-ports \
${opt_args[-l]:+users=${opt_args[-l]:q}} \
hosts - && ret=0
;;
ports)
_wanted ports expl port \
_combination -s '[@:]' '' users-hosts-ports \
${opt_args[-l]:+users=${opt_args[-l]:q}} \
hosts="${line[1]:q}" \
ports - && ret=0
;;
users)
_wanted users expl user \
_combination -s '[@:]' '' users-hosts-ports \
${line[2]:+hosts="${line[2]:q}"} \
${line[3]:+ports="${line[3]:q}"} \
users - && ret=0
;;
esac
return ret
PK [P^{
{
functions/_rloginnu W+A #compdef rlogin rsh remsh=rsh rcp
_rcp_remote_files () {
# There should be coloring based on all the different ls -F classifiers.
local expl remfiles remdispf remdispd suf ret=1
if zstyle -T ":completion:${curcontext}:" remote-access; then
remfiles=(${(M)${(f)"$(rsh ${IPREFIX%:} ls -d1F ${(Q)PREFIX%%[^./][^/]#}\* 2>/dev/null)"}%%[^/]#(|/)})
compset -P '*/'
compset -S '/*' || suf='remote file'
remdispf=(${remfiles:#*/})
remdispd=(${(M)remfiles:#*/})
_tags files
while _tags; do
while _next_label files expl ${suf:-remote directory}; do
[[ -n $suf ]] && compadd "$@" "$expl[@]" -d remdispf \
${(q)remdispf%[*=@|]} && ret=0
compadd ${suf:+-S/} "$@" "$expl[@]" -d remdispd \
${(q)remdispd%/} && ret=0
done
(( ret )) || return 0
done
else
_message -e remote-files 'remote file'
fi
}
_rlogin () {
case "$service" in
rlogin)
_arguments -s \
'-8[allow 8-Bit data]' \
'-e-[specify escape character]:escape character:' \
'-l[specify login user name]:login as:_rlogin_users' \
':remote host name:_rlogin_hosts'
;;
rsh|remsh)
local context state line ret=1
typeset -A opt_args
_arguments -s \
'-n[ignore stdin]' \
'-l[specify login user name]:login as:_rlogin_users' \
':remote host name:_rlogin_hosts' \
'(-):command: _command_names -e' \
'*::command:->command' && ret=0
if [[ -n "$state" ]]; then
shift 1 words
(( CURRENT-- ))
_normal && ret=0
fi
return ret
;;
rcp)
local curcontext="$curcontext" state line ret=1 expl
typeset -A opt_args
_arguments -C -s \
'-p[preserve modification times]' \
'-r[recursively copy directories]' \
'*:files:->files' && ret=0
if [[ -n "$state" ]]; then
if compset -P '*:'; then
_rcp_remote_files && ret=0
elif compset -P '*@'; then
_wanted hosts expl host _rlogin_hosts -S: && ret=0
else
_alternative \
'files:: _files' \
'hosts:: _rlogin_all_hosts -S:' \
'users:: _rlogin_users -qS@' && ret=0
fi
fi
return ret
;;
esac
}
_rlogin_users () {
_tags users && _combination -s '[:@]' my-accounts users-hosts users "$@"
}
_rlogin_hosts () {
_tags hosts &&
if [[ "$IPREFIX" == *@ ]]; then
_combination -s '[:@]' my-accounts users-hosts "users=${IPREFIX/@}" hosts "$@"
else
_combination -s '[:@]' my-accounts users-hosts \
${opt_args[-l]:+"users=${opt_args[-l]:q}"} hosts "$@"
fi
}
_rlogin_all_hosts () {
_tags hosts && _combination -s '[:@]' my-accounts users-hosts hosts "$@"
}
_rlogin "$@"
PK [}\j j functions/_gnutlsnu W+A #compdef gnutls-cli gnutls-cli-debug certtool srptool
local _gnutls_supported _gnutls_supported_certtypes
local _gnutls_supported_protocols _gnutls_supported_macs
local _gnutls_supported_kx _gnutls_supported_comp
local _gnutls_cli_common_args
_gnutls_cli_common_args=(
'(-d --debug)'{-d,--debug}':debug level'
'(-p --port)'{-p,--port}':port'
'(-h --help)'{-h,--help}'[help]' \
)
case "$service" in
(gnutls-cli)
_gnutls_supported="$(gnutls-cli --list)"
_gnutls_supported_certtypes=(${(s:, :)${${(M)${(f)_gnutls_supported}:#Certificate types:*}#Certificate types: }})
_gnutls_supported_protocols=(${(s:, :)${${(M)${(f)_gnutls_supported}:#Protocols:*}#Protocols: }})
_gnutls_supported_ciphers=(${(s:, :)${${(M)${(f)_gnutls_supported}:#Ciphers:*}#Ciphers: }})
_gnutls_supported_macs=(${(s:, :)${${(M)${(f)_gnutls_supported}:#MACs:*}#MACs: }})
_gnutls_supported_kx=(${(s:, :)${${(M)${(f)_gnutls_supported}:#Key exchange algorithms:*}#Key exchange algorithms: }})
_gnutls_supported_comp=(${(s:, :)${${(M)${(f)_gnutls_supported}:#Compression methods:*}#Compression methods: }})
_arguments \
"$_gnutls_cli_common_args[@]" \
'(-r --resume)'{-r,--resume}'[resume session]' \
'(-s --starttls)'{-s,--starttls}'[start TLS on EOF or SIGALRM]' \
'--crlf[send CR LF instead of LF]' \
'--x509fmtder[use DER format for certificates to read from]' \
'(-f --fingerprint)'{-f,--fingerprint}'[send the openpgp fingerprint instead of the key]' \
'--disable-extensions[disable all the TLS extensions]' \
'--xml[print the certificate information in XML format]' \
'--print-cert[print the certificate in PEM format]' \
'--recordsize:maximum record size to advertise:' \
'(-V --verbose)'{-V,--verbose}'[more verbose output]' \
'--ciphers:ciphers to enable:('"$_gnutls_supported_ciphers"')' \
'--protocols:protocols to enable:('"$_gnutls_supported_protocols"')' \
'--comp:compression methods to enable:('"$_gnutls_supported_comp"')' \
'--macs:MACs to enable:('"$_gnutls_supported_macs"')' \
'--kx:key exchange methods to enable:('"$_gnutls_supported_kx"')' \
'--ctypes:certificate types to enable:('"$_gnutls_supported_certtypes"')' \
'--x509cafile:certificate file to use:_files' \
'--x509crlfile:CRL file to use:_files' \
'--pgpkeyfile:PGP key file to use:_files' \
'--pgpkeyring:PGP key ring file to use:_files' \
'--pgptrustdb:PGP trustdb file to use:_files' \
'--pgpcertfile:PGP public key (certificate) file to use:_files' \
'--x509keyfile:X.509 key file to use:_files' \
'--x509certfile:X.509 certificate file to use:_files' \
'--srpusername:SRP username to use' \
'--srppasswd:SRP password to use' \
'--insecure[do not require server cert validation]' \
'(-l --list)'{-l,--list}'[print list of the supported algorithms/modes]' \
'(-v --version)'{-v,--version}'[print version number]' \
'--copyright[print license]' \
':hostname:_hosts'
;;
(gnutls-cli-debug)
_arguments \
"$_gnutls_cli_common_args[@]" \
'(-v --verbose)'{-v,--verbose}'[more verbose output]' \
':hostname:_hosts'
;;
(certtool)
_arguments \
'(-s --generate-self-signed)'{-s,--generate-self-signed}'[generate a self-signed certificate]' \
'(-c --generate-certificate)'{-c,--generate-certificate}'[generate a signed certificate]' \
'--generate-crl[generate a CRL]' \
'(-u --update-certificate)'{-u,--update-certificate}'[update a signed certificate]' \
'(-p --generate-privkey)'{-p,--generate-privkey}'[generate a private key]' \
'(-q --generate-request)'{-q,--generate-request}'[generate a PKCS #10 certificate request]' \
'(-e --verify-chain)'{-e,--verify-chain}'[verify a PEM encoded certificate chain]' \
'--verify-crl[verify a CRL]' \
'--generate-dh-params[generate PKCS #3 encoded Diffie Hellman parameters]' \
'--get-dh-params[get the included PKCS #3 encoded Diffie Hellman parameters]' \
'--load-privkey:private key file:_files' \
'--load-request:certificate request file:_files' \
'--load-certificate:certificate file:_files' \
'--load-ca-privkey:certificate authority private key file:_files' \
'--load-ca-certificate:certificate authority certificate file:_files' \
'--password:password' \
'(-i --certificate-info)'{-i,--certificate-info}'[print information on a certificate]' \
'(-l --crl-info)'{-l,--crl-info}'[print information on a CRL]' \
'--p12-info[print information on a PKCS #12 structure]' \
'--p7-info[print information on a PKCS #7 structure]' \
'--smime-to-p7[convert S/MIME to PKCS #7 structure]' \
'(-k --key-info)'{-k,--key-info}'[print information on a private key]' \
'--fix-key[regenerate the parameters in a private key]' \
'--to-p12[generate a PKCS #12 structure]' \
'(-8 --pkcs8)'{-8,--pkcs8}'[use PKCS #8 format for private keys]' \
'--dsa[use DSA keys]' \
'--hash:hash algorithm for signing:(MD5 SHA1 RMD160)' \
'--export-ciphers[use weak encryption algorithms]' \
'--inder[use DER format for input certificates and private keys]' \
'--xml[use XML format for output certificates]' \
'--outder[use DER format for output certificates and private keys]' \
'--bits:number of bits for key generation' \
'--outfile:output file:_files ' \
'--infile:input file:_files ' \
'--template:template file to use for non-interactive operation:_files' \
'(-d --debug)'{-d,--debug}':debug level' \
'(-h --help)'{-h,--help}'[show help]' \
'(-v --version)'{-v,--version}'[show version]' \
'--copyright[shows license]'
;;
(srptool)
_arguments \
'(-u --username)'{-u,--username}':username:_users' \
'(-p --passwd)'{-p,--passwd}':password file:_files' \
'(-i --index)'{-i,--index}':index of params in tpasswd.conf' \
'(-s --salt)'{-s,--salt}':salt size for crypt algorithm' \
'--verify[just verify password]' \
'(-c --passwd-conf)'{-c,--passwd-conf}':password conf file:_files' \
'--create-conf:generate a tpasswd.conf file:_files' \
'(-v --version)'{-v,--version}'[show version]' \
'(-h --help)'{-h,--help}'[show help]'
;;
esac
PK [gY functions/_requestednu W+A #autoload
local __gopt
__gopt=()
zparseopts -D -a __gopt 1 2 V J x
if comptags -R "$1"; then
if [[ $# -gt 3 ]]; then
_all_labels - "$__gopt[@]" "$@" || return 1
elif [[ $# -gt 1 ]]; then
_description "$__gopt[@]" "$@"
fi
return 0
else
return 1
fi
PK [ʦt t functions/_apachectlnu W+A #compdef apachectl apache2ctl
_sub_commands start startssl stop restart fullstatus status graceful configtest help
PK [W} functions/_apt-movenu W+A #compdef apt-move
local curcontext="$curcontext" state line cmds ret=1
typeset -A opt_args
_arguments -C \
'-a[process all packages]' \
'-c[specify an alternative configuration file]' \
'-d[override the DIST setting]' \
'-f[override the MAXDELETE setting]' \
'-q[be quiet; suppress normal output]' \
'-t[show what apt-move would do, but do not actually do anything]' \
'1: :->cmds' \
'*: :->args' && ret=0
case $state in
cmds)
cmds=(
'get:update your master files from local apt'
'getlocal:alias of get'
'fsck:fix broken repositories'
'move:move cache files into mirror tree'
'movefile:move files into the repository'
'delete:delete obsolete packages'
'packages:create new local Packages files'
'update:alias for: get move delete packages'
'local:alias for: move delete packages'
'localupdate:alias for: getlocal move delete packages'
'mirror:update your local mirror from remote rsync site'
'sync:same as mirror, but only gets packages that you currently have installed on your system'
'exclude:prints a list of all packages EXCLUDED from the mirror by the .exclude file'
'listbin:prints lists of packages which can serve as the input to mirrorbin(mirror,sync,repo)'
'listsrc:same as listbin, but lists source packages'
'mirrorbin:same as mirror, but gets the packages specified on stdin'
'mirrorsrc:same as mirrorbin, but gets source packages'
)
_describe -t commands 'apt-move command' cmds && ret=0
;;
args)
case $line[1] in
get|getlocal)
_directories && ret=0
;;
movefile)
_files -g "*.d(sc|eb)(-.)" && ret=0
;;
listbin)
_wanted lists expl list compadd mirror sync repo
;;
esac
;;
esac
return ret
PK [i}u u functions/_directoriesnu W+A #compdef rmdir df dircmp -P -value-,*path,-default-
local expl
_wanted directories expl directory _files -/ "$@" -
PK [V- functions/_java_classnu W+A #autoload
# Should probably add some sort of cache.
# Should we call _multi_parts instead of compadd?
local classpath i expl
local -a c
local method type
zparseopts -D -E -a classpath t:=type m:=method cp: classpath:
: "$classpath[@]"
classpath="${${classpath[2]:-${CLASSPATH:-.}}//\\:/:}"
: "$classpath[@]"
for i in "${(s.:.)classpath}"; do
[[ -z $i ]] && i=.
if [[ -f $i ]] && [[ "$i" == *.(jar|zip|war|ear) ]]; then
c+=( ${${${(M)$(_call_program jar_classes jar -tf $i)##*.class}%%.class}:gs#/#.#} )
elif [[ -d $i ]]; then
c+=( $i/**/*.class(.:r:s/.class//:s#$i/##:gs#/#.#) )
fi
done
_wanted classes expl 'java class' compadd "$@" -M 'r:|.=* r:|=*' -a - c
PK [.a|_, _, functions/zsh-mime-setupnu W+A emulate -L zsh
setopt extendedglob cbases
local opt o_verbose o_list
autoload -Uz zsh-mime-handler
while getopts "flv" opt; do
case $opt in
# List: show existing suffixes and their handlers then exit.
(l)
o_list=1
;;
# Verbose; print diagnostics to stdout.
(v)
o_verbose=1
;;
# Force; discard any existing settings before reading.
(f)
unset -m zsh_mime_\*
;;
(*)
[[ $opt = \? ]] || print -r "Option $opt not handled, complain" >&2
return 1
;;
esac
done
(( OPTIND > 1 )) && shift $(( OPTIND - 1 ))
if [[ -n $o_list ]]; then
# List and return. Remember that suffixes may be overridden by styles.
# However, we require some sort of standard handler to be present,
# so we don't need to search styles for suffixes that aren't
# handled. Yet.
local list_word
local -a handlers
if (( $# )); then
handlers=(${(k)zsh_mime_handlers[(I)${(j.|.)*}]})
else
handlers=(${(k)zsh_mime_handlers})
fi
for suffix in ${(o)handlers}; do
zstyle -s ":mime:.$suffix:" handler list_word ||
list_word=${zsh_mime_handlers[$suffix]}
print ${(r.10.)suffix}$list_word
zstyle -s ":mime:.$suffix:" flags list_word ||
list_word=${zsh_mime_flags[$suffix]}
if [[ -n $list_word ]]; then
print " flags: $list_word"
fi
done
return 0
fi
# Handler for each suffix.
(( ${+zsh_mime_handlers} )) || typeset -gA zsh_mime_handlers
# Corresponding flags, if any, for handler
(( ${+zsh_mime_flags} )) || typeset -gA zsh_mime_flags
# Internal maps read from MIME configuration files.
# Note we don't remember the types, just the mappings from suffixes
# to handlers and their flags.
typeset -A suffix_type_map type_handler_map type_flags_map
local -a default_type_files default_cap_files
local -a type_files cap_files array match mbegin mend
local file line type suffix exts elt flags line2
integer ind
default_type_files=(~/.mime.types /etc/mime.types)
default_cap_files=(~/.mailcap /etc/mailcap)
# Customizable list of files to examine.
if zstyle -a :mime: mime-types type_files; then
while (( (ind = ${type_files[(I)+]}) > 0 )); do
type_files[$ind]=($default_type_files)
done
else
type_files=($default_type_files)
fi
if zstyle -a :mime: mailcap cap_files; then
while (( (ind = ${cap_files[(I)+]}) > 0 )); do
cap_files[$ind]=($default_cap_files)
done
else
cap_files=($default_cap_files)
fi
{
mime-setup-add-type() {
local type suffix
local -a array
type=$1
shift
while (( $# )); do
# `.ps' instead of `ps' has been noted
suffix=${1##.}
shift
if [[ -z $suffix_type_map[$suffix] ]]; then
[[ -n $o_verbose ]] &&
print -r "Adding type $type for $suffix" >&2
suffix_type_map[$suffix]=$type
else
# Skip duplicates.
array=(${=suffix_type_map[$suffix]})
if [[ ${array[(I)$type]} -eq 0 ]]; then
[[ -n $o_verbose ]] &&
print -r "Appending type $type for already defined $suffix" >&2
suffix_type_map[$suffix]+=" $type"
fi
fi
done
}
# Loop through files to find suffixes for MIME types.
# Earlier entries take precedence, so the files need to be listed
# with the user's own first. This also means pre-existing
# values in suffix_type_map are respected.
for file in $type_files; do
[[ -r $file ]] || continue
# For once we rely on the fact that read handles continuation
# lines ending in backslashes, i.e. there's no -r.
while read line; do
# Skip blank or comment lines.
[[ $line = [[:space:]]#(\#*|) ]] && continue
# There are two types of line you find in MIME type files.
# The original simple sort contains the type name then suffixes
# separated by whitespace. However, Netscape insists
# on adding lines with backslash continuation with
# key="value" pairs. So we'd better handle both.
if [[ $line = *=* ]]; then
# Gory.
# This relies on the fact that a typical entry:
# type=video/x-mpeg2 desc="MPEG2 Video" exts="mpv2,mp2v"
# looks like a parameter assignment. However, we really
# don't want to be screwed up by future extensions,
# so we split the elements to an array and pick out the
# ones we're interested in.
type= exts=
# Syntactically split line to preserve quoted words.
array=(${(z)line})
for elt in $array; do
if [[ $elt = (type|exts)=* ]]; then
eval $elt
fi
done
# Get extensions by splitting on comma
array=(${(s.,.)exts})
[[ -n $type ]] && mime-setup-add-type $type $array
else
# Simple.
mime-setup-add-type ${=line}
fi
done <$file
done
} always {
unfunction mime-setup-add-type >&/dev/null
}
local -a pats_prio o_prios
local o_overwrite sentinel
typeset -A type_prio_flags_map type_prio_src_map type_prio_mprio_map
integer src_id prio mprio
# A list of keywords indicating the methods used to break ties amongst multiple
# entries. The following keywords are accepted:
# files: The order of files read: Entries from files read earlier are preferred
# (The default value of the variable is a list with this keyword alone)
# priority: The priority flag is matched in the entry. Can be a value from 0 to
# 9. The default priority is 5. Higher priorities are preferred.
# flags: See the mailcap-prio-flags option
# place: Always overrides. Useful for specifying that entries read later are
# preferred.
#
# As the program reads mailcap entries, if it encounters a duplicate
# entry, each of the keywords in the list are checked to see if the new
# entry can override the existing entry. If none of the keywords are able
# to decide whether the new entry should be preferred to the older one, the
# new entry is discarded.
zstyle -a :mime: mailcap-priorities o_prios || o_prios=(files)
# This style is used as an argument for the flags test in mailcap-priorities.
# This is a list of patterns, each of which is tested against the flags for the
# mailcap entry. An match with a pattern ahead in the list is preferred as
# opposed to a match later in the list. An unmatched item is least preferred.
zstyle -a :mime: mailcap-prio-flags pats_prio
# Loop through files to find handlers for types.
((src_id = 0))
for file in $cap_files; do
[[ -r $file ]] || continue
((src_id = src_id + 1))
# Oh, great. We need to preserve backslashes inside the line,
# but need to manage continuation lines.
while read -r line; do
# Skip blank or comment lines.
[[ $line = [[:space:]]#(\#*|) ]] && continue
while [[ $line = (#b)(*)\\ ]]; do
line=$match[1]
read -r line2 || break
line+=$line2
done
# Guess what, this file has a completely different format.
# See mailcap(4).
# The biggest unpleasantness here is that the fields are
# delimited by semicolons, but the command field, which
# is the one we want to extract, may itself contain backslashed
# semicolons.
if [[ $line = (#b)[[:space:]]#([^[:space:]\;]##)[[:space:]]#\;(*) ]]
then
# this is the only form we can handle, but there's no point
# issuing a warning for other forms.
type=$match[1]
line=$match[2]
# See if it has flags after the command.
if [[ $line = (#b)(([^\;\\]|\\\;|\\[^\;])#)\;(*) ]]; then
line=$match[1]
flags=$match[3]
else
flags=
fi
# Remove quotes from semicolons
line=${line//\\\;/\;}
# and remove any surrounding white space --- this might
# make the handler empty.
line=${${line##[[:space:]]#}%%[[:space:]]}
((prio = 0))
for i in $pats_prio; do
# print -r "Comparing $i with '$flags'" >&2
[[ $flags = ${~i} ]] && break
# print -r "Comparison failed" >&2
((prio = prio + 1))
done
((mprio=5))
[[ $flags = (#b)*priority=([0-9])* ]] && mprio=$match[1]
sentinel=no
if [[ -n $type_handler_map[$type] ]]; then
for i in $o_prios; do
case $i in
(files)
if [[ $src_id -lt $type_prio_src_map[$type] ]]; then
sentinel=yes; break
elif [[ $src_id -gt $type_prio_src_map[$type] ]]; then
sentinel=no; break
fi
;;
(priority)
if [[ $mprio -gt $type_prio_mprio_map[$type] ]]; then
sentinel=yes; break
elif [[ $mprio -lt $type_prio_mprio_map[$type] ]]; then
sentinel=no; break
fi
;;
(flags)
if [[ $prio -lt $type_prio_flags_map[$type] ]]; then
sentinel=yes; break
elif [[ $prio -gt $type_prio_flags_map[$type] ]]; then
sentinel=no; break
fi
;;
(place)
sentinel=yes
break
;;
esac
done
else
sentinel=yes
fi
if [[ $sentinel = yes ]]; then
if [[ -n $o_verbose ]]; then
if [[ -n $type_handler_map[$type] ]]; then
print -r "Overriding" >&2
else
print -r "Adding" >&2
fi
print -r " handler for type $type:" >&2
print -r " $line" >&2
fi
type_handler_map[$type]=$line
type_flags_map[$type]=$flags
type_prio_src_map[$type]=$src_id
type_prio_flags_map[$type]=$prio
type_prio_mprio_map[$type]=$mprio
if [[ -n $flags && -n $o_verbose ]]; then
print -r " with flags $flags" >&2
fi
elif [[ -n $o_verbose ]]; then
print -r "Skipping handler for already defined type $type:" >&2
print -r " $line" >&2
if [[ -n $flags ]]; then
print -r " with flags $flags" >&2
fi
fi
fi
done <$file
done
# Check for styles which override whatever is in the file.
# We need to make sure there is a handler set up; for some
# uses we may need to defer checking styles until zsh-mime-handler.
# How much we need to do here is a moot point.
zstyle -L | while read line; do
array=(${(Q)${(z)line}})
if [[ $array[3] = (handler|flags) && \
$array[2] = (#b):mime:.([^:]##):(*) ]]; then
suffix=$match[1]
# Make sure there is a suffix alias set up for this.
alias -s $suffix >&/dev/null || alias -s $suffix=zsh-mime-handler
# Also for upper case variant
alias -s ${(U)suffix} >&/dev/null || alias -s ${(U)suffix}=zsh-mime-handler
fi
done
# Now associate the suffixes directly with handlers.
# We just look for the first one with a handler.
# If there is no handler, we don't bother registering an alias
# for the suffix.
for suffix line in ${(kv)suffix_type_map}; do
# Skip if we already have a handler.
[[ -n $zsh_mime_handlers[$suffix] ]] && continue
# Split the space-separated list of types.
array=(${=line})
# Find the first type with a handler.
line2=
for type in $array; do
line2=${type_handler_map[$type]}
[[ -n $line2 ]] && break
done
# See if there is a generic type/* handler.
# TODO: do we need to consider other forms of wildcard?
if [[ -z $line2 ]]; then
for type in $array; do
type="${type%%/*}/*"
line2=${type_handler_map[$type]}
[[ -n $line2 ]] && break
done
fi
if [[ -n $line2 ]]; then
# Found a type with a handler.
# Install the zsh handler as an alias, but never override
# existing suffix handling.
alias -s $suffix >&/dev/null || alias -s $suffix=zsh-mime-handler
alias -s ${(U)suffix} >&/dev/null || alias -s ${(U)suffix}=zsh-mime-handler
zsh_mime_handlers[$suffix]=$line2
zsh_mime_flags[$suffix]=$type_flags_map[$type]
fi
done
true
PK [W_ _ functions/_vorbiscommentnu W+A #compdef vorbiscomment
#Written by Jesse Weinstein , Wed Jul 19 15:31:11 2006
#Version 0.9 - could handle -t option slightly better
#Released under the MIT license (or any compatible free-content license)
#i.e. do whatever you like with it, but credit me.
_arguments \
'-h[help]' \
'-q[quiet]' \
'(-a -w -q -c -t 2)-l[list comments]' \
'(-l)-a[append comments]' \
'(-l)-w[overwrite comments]' \
'(-l -c)-t[tag and value]:: ' \
'(-l -t)-c[tag file]::_files' \
'1:OGG file:_files -g \*.ogg' \
'(-l)2:output OGG file:_files -g \*.ogg' \
&& return 0
PK [ȧMS S functions/_cplaynu W+A #compdef cplay
_arguments -s \
'-n[enable restricted mode]' \
'-r[toggle playlist repeat mode]' \
'-R[toggle playlist random mode]' \
'-v[toggle PCM and MASTER volume control]' \
'*:playlist or directory or audio file:_files -g "*.(mp3|mp2|ogg|669|amf|ams|dsm|far|it|med|mod|mt2|mtm|okt|s3m|stm|ult|gdm|xm|m3u|pls|spx|wav|au)"'
PK [!a, , functions/VCS_INFO_detect_svnnu W+A ## vim:ft=zsh
## subversion support by: Frank Terbeck
## Distributed under the same BSD-ish license as zsh itself.
setopt localoptions NO_shwordsplit
[[ $1 == '--flavours' ]] && return 1
VCS_INFO_check_com ${vcs_comm[cmd]} || return 1
[[ -d ".svn" ]] && return 0
return 1
PK [ functions/_commandnu W+A #compdef command
local ret
# indicate if this is a precommand modifier
[[ $service = command ]] && precommands+=(command)
if [[ CURRENT -ge 3 ]]; then
compset -n 2
_normal && ret=0
else
_path_commands "$@" && ret=0
fi
return ret
PK [7 functions/_redirectnu W+A #compdef -redirect-
local strs _comp_command1 _comp_command2 _comp_command
_set_command
strs=( -default- )
if [[ "$CURRENT" != "1" ]]; then
strs=( "${_comp_command}" "$strs[@]" )
if [[ -n "$_comp_command1" ]]; then
strs=( "${_comp_command1}" "$strs[@]" )
[[ -n "$_comp_command2" ]] &&
strs=( "${_comp_command2}" "$strs[@]" )
fi
fi
_dispatch -redirect-,{${compstate[redirect]},-default-},${^strs}
PK [uF9 9 functions/_cdrdaonu W+A #compdef cdrdao
# TODO: Options must come before parameters.
# Command completion and main loop {{{1
_cdrdao_commands () {
local -a commands
commands=(
'show-toc:print out a summary of a TOC'
'read-toc:create a TOC file based on a CD'
'read-cd:create a TOC file and image file based on a CD'
'read-cddb:add CD-TEXT data from a CDDB server to a TOC'
'show-data:print out samples that would be written to CD'
'read-test:check if data described in a TOC can be read from a CD'
'disk-info:show information about a CD'
'msinfo:generate mkisofs command for creating multi-session CD'
'unlock:try to unlock a recorder after a failed run'
'blank:blank a CD-RW'
'simulate:simulate a write'
'write:write a CD based on a TOC'
'copy:copy a CD'
)
_describe -t commands 'cdrdao command' commands && ret=0
}
_cdrdao () {
local curcontext=$curcontext ret=1
local context state line
typeset -A opt_args
_arguments \
':command:->command' \
'*::options:->options' && ret=0
case $state in
(command)
_cdrdao_commands
;;
(options)
curcontext="${curcontext%:*:*}:cdrdao-$words[1]:"
_call_function ret _cdrdao-$words[1]
;;
esac
}
# Common arguments {{{1
declare -ga tmpfile_args
tmpfile_args=(
'--tmpdir[directory to store temporary data in]:directory:_directories'
'--keep[do not remove temporary data when done]')
declare -ga device_args
device_args=(
'--device[set SCSI address of the CD recorder]:device:__cdrdao-device'
'--driver[use given driver for the CD recorder]:driver:__cdrdao-drivers')
# TODO: Gah! Fix a cddb server spec matcher
declare -ga cddb_args
cddb_args=(
'--cddb-servers[specify list of CDDB servers to use]:CDDB servers:'
'--cddb-timeout[specify timeout in seconds for connections to CDDB servers]: :_guard "[[\:digit\:]]" timeout'
'--cddb-directory[directory where fetched CDDB records will be stored]:directory:_directories')
declare -g paranoiamode_arg=
paranoiamode_arg='--paranoia-mode[set correction mode for digital audio extraction]:mode:(("0\:no checking" "1\:perform overlapped reading to avoid jitter" "2\:like 1 but with checks of read audio data" "3\:like 2 but with scratch detection/repair (default)"))'
declare -g fasttoc_arg=
fasttoc_arg='--fast-toc[skip pre-gap-length and index-mark extraction]'
declare -g swap_arg=
swap_arg='--swap[swap the byte order of samples]'
declare -g reload_arg=
reload_arg='--reload[reload the disk if necessary]'
declare -g eject_arg=
eject_arg='--eject[eject CD after completed operation]'
declare -g speed_arg=
speed_arg='-speed[set writing speed]: :_guard "[[\:digit\:]]##" speed'
declare -ga common_args
common_args=(
'(*)'{-h,--help}'[display command/option summary]'
'-v[set verbosity level]: :_guard "[[\:digit\:]]##" verbosity')
declare -ga common_toc_args
common_toc_args=(
$common_args
':TOC file:_files -g "*.toc"')
declare -ga common_device_args
common_device_args=(
$common_args
$device_args)
declare -ga common_toc_device_args
common_toc_device_args=(
$common_toc_args
$common_device_args
$force_arg)
declare -ga common_read_args
common_read_args=(
'--rspeed[set reading speed]: :_guard "[[\:digit\:]]##" speed'
'--session[specify what session to process on multi-session CDs]: :_guard "[[\:digit\:]]##" "session number"'
'--read-subchan[set sub-channel reading-mode]:mode:(("rw\:de-interleaved and error corrected" "rw_raw\:not de-interleaved, not error-corrected, and L-EC data included"))'
'--tao-source[indicate that source CD was written in TAO mode]'
'--with-cddb[retrieve CD-TEXT data from a CDDB server]')
# Sub-command completion {{{1
_cdrdao-show-toc () {
__cdrdao-show-toc-or-toc-info-or-toc-size
}
_cdrdao-toc-info () {
__cdrdao-show-toc-or-toc-info-or-toc-size
}
_cdrdao-toc-size () {
__cdrdao-show-toc-or-toc-info-or-toc-size
}
__cdrdao-show-toc-or-toc-info-or-toc-size () {
_arguments \
$common_toc_args \
$tmpfile_args && ret=0
}
_cdrdao-read-toc () {
__cdrdao-read-toc-or-read-cd \
$fasttoc_arg
}
_cdrdao-read-cd () {
__cdrdao-read-toc-or-read-cd \
$paranoiamode_arg
}
__cdrdao-read-toc-or-read-cd () {
local -a dependent_args
__cdrdao-read-toc-or-read-cd-or-copy-dependent-args
_arguments \
$common_toc_device_args \
$common_read_args \
$dependent_args
'--datafile[set name of data file placed in TOC file]:file:_files' \
'--read-raw[read data in raw format from CD]' \
'--no-mode2-mixed[if MODE2_FORM1 or MODE2_FORM2, do not extract as MODE2_FORM_MIX]' \
$* && ret=0
}
_cdrdao-read-cddb () {
_arguments \
$common_toc_args \
$cddb_args && ret=0
}
_cdrdao-show-data () {
_arguments \
$common_toc_args \
$swap_arg && ret=0
}
_cdrdao-read-test () {
_arguments \
$common_toc_args && ret=0
}
_cdrdao-disk-info () {
__cdrdao-disk-info-or-drive-info
}
__cdrdao-disk-info-or-drive-info () {
_arguments \
$common_device_args && ret=0
}
_cdrdao-msinfo () {
_arguments \
$common_device_args \
$reload_arg && ret=0
}
_cdrdao-drive-info () {
__cdrdao-disk-info-or-drive-info
}
_cdrdao-unlock () {
_arguments \
$common_device_args \
$reload_arg \
$eject_arg && ret=0
}
_cdrdao-blank () {
_arguments \
$common_device_args \
$speed_arg \
'--blank-mode[set the blanking mode]:blanking mode:(("full\:completely erase data" "minimal\:only dereference data"))' \
$eject_arg && ret=0
}
_cdrdao-scanbus () {
_arguments \
$common_args && ret=0
}
_cdrdao-simulate () {
__cdrdao-simulate-or-write
}
__cdrdao-simulate-or-write () {
local capacity_arg=
if (( $words[(I)--full-burn] )); then
capacity_arg='--capacity[set disk capacity for --full-burn]: :_guard "[[\:digit\:]]" minutes'
fi
_arguments \
$common_toc_device_args \
$speed_arg \
'--multi[do not close the session after successful write]' \
'--overburn[allow overburing of medium]' \
'--full-burn[force burning to the outer disk edge]' \
$capacity_arg \
$eject_arg \
$swap_arg \
'--buffers[set fifo buffer size]: :_guard "[[\:digit\:]]" size' \
$reload_arg \
$tmpfile_args \
'-n[do not pause before writing]' \
$* && ret=0
}
_cdrdao-write () {
__cdrdao-simulate-or-write \
'--simulate[only perform a write simulation]' \
'--buffer-under-run-protection[whether to use buffer under-run protection]:buffer under-run protection setting:(("0\:disable buffer under-run protection" "1\:enable buffer under-run protection"))' \
'--write-speed-control[whether to use writing-speed control]:writing-speed control setting:(("0\:disable writing-speed control" "1\:enable writing-speed control"))' \
$*
}
__cdrdao-read-toc-or-read-cd-or-copy-dependent-args () {
if (( words[(I)--tao-source] )); then
dependent_args+='--tao-source-adjust[specify number of link blocks for tracks written in TAO mode]: :_guard "[[\:digit\:]]##" "link blocks"'
fi
if (( words[(I)--with-cddb] )); then
dependent_args+=$cddb_args
fi
}
_cdrdao-copy () {
local -ga dependent_args
__cdrdao-read-toc-or-read-cd-or-copy-dependent-args
_cdrdao-write \
$dependent_args
$common_read_args
'--source-device[set SCSI address of the CD reader]:device:__cdrdao-device' \
'--source-driver[use given driver for the CD reader]:driver:__cdrdao-drivers' \
'--on-the-fly[perform on-the-fly copy of CD (no image created)]' \
$fasttoc_arg \
'--keepimage[do not remove generated image when done]' \
$paranoiamode_arg && ret=0
}
# Type completion {{{1
__cdrdao-device () {
# Use cdrdao scanbus and also check what OS we’re running under and provide
# additional stuff, like devices (/dev/sg0)
local -a devices
devices=(${(f)"$(_call_program devices cdrdao scanbus -v 0 2>/dev/null)"})
if (( ${#pipestatus:#0} > 0 )); then
return 1
fi
_wanted devices expl 'device' compadd - $devices
}
__cdrdao-drivers () {
local -a drivers
drivers=(${(f)"$(_call_program drivers cut -d'|' -f4 /usr/share/cdrdao/drivers -s 2>/dev/null | sort -u)"})
if (( ${#pipestatus:#0} > 0 )); then
return 1
fi
_wanted drivers expl 'driver' compadd -qS: - $drivers
}
# }}}1
_cdrdao
PK [#k functions/_arg_compilenu W+A #autoload
# A simple compiler for _arguments descriptions. The first argument of
# _arg_compile is the name of an array parameter in which the parse is
# returned. The remaining arguments form a series of `phrases'. Each
# `phrase' begins with one of the keywords "argument", "option", or "help"
# and consists of a series of keywords and/or values. The syntax is as
# free-form as possible, but "argument" phrases generally must appear in
# the same relative position as the corresponding argument on the command
# line to be completed, and there are some restrictions on ordering of
# keywords and values within each phrase.
#
# Anything appearing before the first phrase or after the last is passed
# through verbatim. (See TODO.) If more detailed mixing of compiled and
# uncompiled fragments is necessary, use two or more calls, either with
# different array names or by passing the output of each previous call
# through the next.
#
# In the documentation below, brackets [ ] indicate optional elements and
# braces { } indicate elements that may be repeated zero or more times.
# Except as noted, bracketed or braced elements may appear in any order
# relative to each other, but tokens within each element are ordered.
#
# argument [POS] [means MSG] [action ACT]
#
# POS may be an integer N for the Nth argument or "*" for all, and
# must appear first if it appears at all.
# MSG is a string to be displayed above the matches in a listing.
# ACT is (currently) as described in the compsys manual.
#
# option OPT [follow HOW] [explain STR] {unless XOR} \
# {[means MSG] [action ACT]} [through PAT [means MSG] [action ACT]]
#
# OPT is the option, prefixed with "*" if it may appear more than once.
# HOW refers to a following argument, and may be one of:
# "close" must appear in the same word (synonyms "join" or "-")
# "next" the argument must appear in the next word (aka "split")
# "loose" the argument may appear in the same or the next word ("+")
# "assign" as loose, but must follow an "=" in the same word ("=")
# HOW should be suffixed with a colon if the following argument is
# _not_ required to appear.
# STR is to be displayed based on style `description'
# XOR is another option in combination with which OPT may not appear.
# It may be ":" to disable non-option completions when OPT is present.
# MSG is a string to be displayed above the matches in a listing.
# ACT is (currently) as described in the compsys manual.
# PAT is either "*" for "all remaining words on the line" or a pattern
# that, if matched, marks the end of the arguments of this option.
# The "through PAT ..." description must be the last.
# PAT may be suffixed with one colon to narrow the $words array to
# the remainder of the command line, or with two colons to narrow
# to the words before (not including) the next that matches PAT.
#
# help PAT [means MSG] action ACT
#
# ACT is applied to any option output by --help that matches PAT.
# Do not use "help" with commands that do not support --help.
# PAT may be suffixed with a colon if the following argument is
# _not_ required to appear (this is usually inferred from --help).
# MSG is a string to be displayed above the matches in a listing.
# EXAMPLE:
# This is from _gprof in the standard distribution. Note that because of
# the brace expansion trick used in the "function name" case, no attempt
# is made to use `phrase' form; that part gets passed through unchanged.
# It could simply be moved to the _arguments call ahead of "$args[@]".
#
# _arg_compile args -s -{a,b,c,D,h,i,l,L,s,T,v,w,x,y,z} \
# -{A,C,e,E,f,F,J,n,N,O,p,P,q,Q,Z}:'function name:->funcs' \
# option -I means directory action _dir_list \
# option -d follow close means "debug level" \
# option -k means "function names" action '->pair' \
# option -m means "minimum execution count" \
# argument means executable action '_files -g \*\(-\*\)' \
# argument means "profile file" action '_files -g gmon.\*' \
# help '*=name*' means "function name" action '->funcs' \
# help '*=dirs*' means "directory" action _dir_list
# _arguments "$args[@]"
# TODO:
# Verbose forms of various actions, e.g. (but not exactly)
# "state foo" becomes "->foo"
# "completion X explain Y ..." becomes "((X\:Y ...))"
# etc.
# Represent leading "*" in OPT some other way.
# Represent trailing colons in HOW and PAT some other way.
# Stricter syntax checking on HOW, sanity checks on XOR.
# Something less obscure than "unless :" would be nice.
# Warning or other syntax check for stuff after the last phrase.
emulate -L zsh
local -h argspec dspec helpspec prelude xor
local -h -A amap dmap safe
[[ -n "$1" ]] || return 1
[[ ${(tP)${1}} = *-local ]] && { print -R NAME CONFLICT: $1 1>&2; return 1 }
safe[reply]="$1"; shift
# First consume and save anything before the argument phrases
helpspec=()
prelude=()
while (($#))
do
case $1 in
(argument|help|option) break;;
(*) prelude=("$prelude[@]" "$1"); shift;;
esac
done
# Consume all the argument phrases and build the argspec array
while (($#))
do
amap=()
dspec=()
case $1 in
# argument [POS] [means MSG] [action ACT]
(argument)
shift
while (($#))
do
case $1 in
(<1->|\*) amap[position]="$1"; shift;;
(means|action) amap[$1]="$2"; shift 2;;
(argument|option|help) break;;
(*) print -R SYNTAX ERROR at "$@" 1>&2; return 1;;
esac
done
if (( $#amap ))
then
argspec=("$argspec[@]" "${amap[position]}:${amap[means]}:${amap[action]}")
fi;;
# option OPT [follow HOW] [explain STR] {unless XOR} \
# {[through PAT] [means MSG] [action ACT]}
(option)
amap[option]="$2"; shift 2
dmap=()
xor=()
while (( $# ))
do
(( ${+amap[$1]} || ${+dmap[through]} )) && break;
case $1 in
(follow)
amap[follow]="${2:s/join/-/:s/close/-/:s/next//:s/split//:s/loose/+/:s/assign/=/:s/none//}"
shift 2;;
(explain) amap[explain]="[$2]" ; shift 2;;
(unless) xor=("$xor[@]" "${(@)=2}"); shift 2;;
(through|means|action)
while (( $# ))
do
(( ${+dmap[$1]} )) && break 2
case $1 in
(through|means|action) dmap[$1]=":${2}"; shift 2;;
(argument|option|help|follow|explain|unless) break;;
(*) print -R SYNTAX ERROR at "$@" 1>&2; return 1;;
esac
done;;
(argument|option|help) break;;
(*) print -R SYNTAX ERROR at "$@" 1>&2; return 1;;
esac
if (( $#dmap ))
then
dspec=("$dspec[@]" "${dmap[through]}${dmap[means]:-:}${dmap[action]:-:}")
fi
done
if (( $#amap ))
then
argspec=("$argspec[@]" "${xor:+($xor)}${amap[option]}${amap[follow]}${amap[explain]}${dspec}")
fi;;
# help PAT [means MSG] action ACT
(help)
amap[pattern]="$2"; shift 2
while (($#))
do
(( ${+amap[$1]} )) && break;
case $1 in
(means|action) amap[$1]="$2"; shift 2;;
(argument|option|help) break;;
(*) print -R SYNTAX ERROR at "$@" 1>&2; return 1;;
esac
done
if (( $#amap ))
then
helpspec=("$helpspec[@]" "${amap[pattern]}:${amap[means]}:${amap[action]}")
fi;;
(*) break;;
esac
done
eval $safe[reply]'=( "${prelude[@]}" "${argspec[@]}" ${helpspec:+"-- ${helpspec[@]}"} "$@" )'
# print -R _arguments "${prelude[@]:q}" "${argspec[@]:q}" ${helpspec:+"-- ${helpspec[@]:q}"} "$@:q"
return 0
PK [W
W
functions/_qivnu W+A #compdef qiv
_arguments -s \
'(- *)'{-h,--help}'[display help information]' \
'(- *)'{-v,--version}'[display version information]' \
'--display:display:_x_display' \
\*{-F,--file}'[read file names from file]:file:_files' \
'(-e --center)'{-e,--center}'[disable window centering]' \
'(-w --fixed_width -W --fixed_zoom)'{-w,--fixed_width}'[use window with specified width]:width' \
'(-w --fixed_width -W --fixed_zoom)'{-W,--fixed_zoom}'[use window with specified zoom factor]:zoom (percentage)' \
'(-x -y -z --root --root_t --root_s -f --file *)'{-x,--root}'[use image as the current desktop background, centered]:image file:_files' \
'(-x -y -z --root --root_t --root_s -f --file *)'{-y,--root_t}'[use image on the current desktop background, tiled]:image file:_files' \
'(-x -y -z --root --root_t --root_s -f --file *)'{-z,--root_s}'[use image as the current desktop background, stretched]:image file:_files' \
'(-m --maxpect)'{-m,--maxpect}'[expand image to fit screen size]' \
'(-t --scale_down)'{-t,--scale_down}'[shrink images to fit screen size]' \
'(-b --brightness)'{-b,--brightness}'[set brightness]:brightness (-32..32)' \
'(-c --contrast)'{-c,--contrast}'[set contrast]:contrast (-32..32)' \
'(-g --gamma)'{-g,--gamma}'[set gamma]:gamma (-32..32)' \
'(-n --no_filter)'{-n,--no_filter}'[disable filtering of images by extension]' \
'(-i --no_statusbar -I --statusbar)'{-i,--no_statusbar}'[disable statusbar]' \
'(-i --no_statusbar -I --statusbar)'{-I,--statusbar}'[enable statusbar]' \
'(-p --transparency)'{-p,--transparency}'[enable transparency]' \
'(-a --do_grab)'{-a,--do_grab}'[grab the pointer in windowed mode]' \
'(-G --disable_grab)'{-G,--disable_grab}'[disable pointer grabbing]' \
'(-o --bg_color)'{-o,--bg_color}'[set root background color]:color:_x_color' \
'(-s --slide)'{-s,--slide}'[start slideshow immediately]' \
'(-r --random)'{-r,--random}'[shuffle images for slideshow]' \
'(-R --readonly)'{-R,--readonly}'[disable delete feature]' \
'(-S --shuffle)'{-S,--shuffle}'[shuffle images for next/prev feature]' \
'(-d --delay)'{-d,--delay}'[set slideshow delay]:delay (seconds)' \
'(-f --fullscreen)'{-f,--fullscreen}'[use fullscreen window on startup]' \
'(-P --ignore_path_sort)'{-P,--ignore_path_sort}'[sort images by just the filename]' \
'(-M --merged_case_sort)'{-M,--merged_case_sort}'[sort images case-insensitively]' \
'(-N --numeric_sort)'{-N,--numeric_sort}'[numeric image sort]' \
'(-T --watch)'{-T,--watch}'[reload the image if it changes]' \
'*:image file:_files -g "*.(#i)(bmp|eim|gif|jp([eg]|eg)|pcx|png|p[pngb]m|tif(|f)|tga|x[pb]m)(-.)"'
PK [H functions/VCS_INFO_get_data_hgnu W+A ## vim:ft=zsh
## mercurial support by: Frank Terbeck
## with large contributions by Seth House
## Distributed under the same BSD-ish license as zsh itself.
setopt localoptions extendedglob NO_shwordsplit
local hgbase bmfile branchfile rebasefile dirstatefile mqseriesfile \
mqstatusfile mqguardsfile patchdir mergedir \
r_csetid r_lrev r_branch i_bmhash i_bmname \
revformat branchformat hgactionstring hgchanges \
hgbmstring hgmqstring applied_string unapplied_string guards_string
local -a hgid_args defrevformat defbranchformat \
hgbmarks mqpatches mqseries mqguards mqunapplied hgmisc \
i_patchguards i_negguards i_posguards
local -xA hook_com
hgbase=${vcs_comm[basedir]}
rrn=${hgbase:t}
r_csetid='' # changeset id (long hash)
r_lrev='' # local revision
patchdir="${hgbase}/.hg/patches"
mergedir="${hgbase}/.hg/merge/"
bmfile="${hgbase}/.hg/bookmarks"
branchfile="${hgbase}/.hg/branch"
rebasefile="${hgbase}/.hg/rebasestate"
dirstatefile="${hgbase}/.hg/dirstate"
mqstatusfile="${patchdir}/status" # currently applied patches
mqseriesfile="${patchdir}/series" # all patches
mqguardsfile="${patchdir}/guards"
# Look for any --flavours
VCS_INFO_adjust
# Calling the 'hg' program is quite a bit too slow for prompts.
# Disabled by default anyway, so no harm done.
if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-revision ; then
# Calling hexdump is (much) faster than hg but doesn't get the local rev
if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" use-simple \
&& ( VCS_INFO_check_com hexdump ) && [[ -r ${dirstatefile} ]] ; then
r_csetid=$(hexdump -n 20 -e '1/1 "%02x"' ${dirstatefile})
else
hgid_args=( --debug id -i -n -b )
# Looking for changes is a tad bit slower since the dirstate cache must
# first be refreshed before being read
zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" \
"check-for-changes" || hgid_args+=( -r. )
local HGRCPATH
HGRCPATH="/dev/null" ${vcs_comm[cmd]} ${(z)hgid_args} \
| read -r r_csetid r_lrev r_branch
fi
fi
# If the user doesn't opt to invoke hg we can still get the current branch
if [[ -z ${r_branch} && -r ${branchfile} ]] ; then
r_branch=$(< ${branchfile})
fi
# If we still don't know the branch it's safe to assume default
[[ -n ${r_branch} ]] || r_branch="default"
# The working dir has uncommitted-changes if the revision ends with a +
if [[ $r_lrev[-1] == + ]] ; then
hgchanges=1
r_lrev=${r_lrev%+}
r_csetid=${r_csetid%+}
fi
# This directory only exists during a merge
[[ -d $mergedir ]] && hgactionstring="merging"
# This file only exists during a rebase
[[ -e $rebasefile ]] && hgactionstring="rebasing"
### Build the current revision display
[[ -n ${r_csetid} ]] && defrevformat+=( "%h" )
[[ -n ${r_lrev} ]] && defrevformat+=( "%r" )
zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" \
"hgrevformat" revformat || revformat=${(j/:/)defrevformat}
hook_com=( localrev "${r_lrev}" "hash" "${r_csetid}" )
if VCS_INFO_hook 'set-hgrev-format' "${revformat}"; then
zformat -f r_lrev "${revformat}" \
"r:${hook_com[localrev]}" "h:${hook_com[hash]}"
else
r_lrev=${hook_com[rev-replace]}
fi
hook_com=()
### Build the branch display
[[ -n ${r_branch} ]] && defbranchformat+=( "%b" )
[[ -n ${r_lrev} ]] && defbranchformat+=( "%r" )
zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" \
branchformat branchformat || branchformat=${(j/:/)defbranchformat}
hook_com=( branch "${r_branch}" revision "${r_lrev}" )
if VCS_INFO_hook 'set-branch-format' "${branchformat}"; then
zformat -f branchformat "${branchformat}" \
"b:${hook_com[branch]}" "r:${hook_com[revision]}"
else
branchformat=${hook_com[branch-replace]}
fi
hook_com=()
### Look for current Bookmarks (this requires knowing the changeset id)
if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-bookmarks \
&& [[ -r "${bmfile}" ]] && [[ -n "$r_csetid" ]] ; then
while read -r i_bmhash i_bmname ; do
# Compare hash in bookmarks file with changeset id
[[ $r_csetid == $i_bmhash ]] && hgbmarks+=( $i_bmname )
done < ${bmfile}
if VCS_INFO_hook 'gen-hg-bookmark-string' "${hgbmarks[@]}"; then
hgbmstring=${(j:, :)hgbmarks}
else
hgbmstring=${hook_com[hg-bookmark-string]}
fi
hook_com=()
fi
### Look for any applied Mercurial Queue patches
if zstyle -T ":vcs_info:${vcs}:${usercontext}:${rrn}" get-mq \
&& [[ -d $patchdir ]] ; then
if [[ -e $mqstatusfile ]]; then
mqpatches=( ${${(f)"$(< "${patchdir}/status")"}/(#s)[a-f0-9]##:/} )
mqpatches=( ${(Oa)mqpatches} )
fi
if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-unapplied \
&& [[ -r ${mqseriesfile} ]]; then
# Okay, here's a little something that assembles a list of unapplied
# patches that takes into account if mq-guards are active or not.
# Collect active guards
if [[ -r ${mqguardsfile} ]]; then
mqguards=( ${(f)"$(< "${mqguardsfile}")"} )
mqguards=( ${(oa)mqguards} )
fi
while read -r i_patch i_patchguards ; do
# Skip commented lines
[[ ${i_patch} == [[:space:]]#"#"* ]] && continue
# Keep list of all patches
mqseries+=( $i_patch )
# Separate negative and positive guards to more easily find the
# intersection of active guards with patch guards
i_patchguards=( ${(s: :)i_patchguards} )
i_negguards=( ${${(M)i_patchguards:#*"#-"*}/(#s)\#-/} )
i_posguards=( ${${(M)i_patchguards:#*"#+"*}/(#s)\#+/} )
# Patch with any negative guards is never pushed if guard is active
if [[ ${#i_negguards} -gt 0
&& ${#${(@M)mqguards:#${(~j,|,)i_negguards}}} -gt 0 ]] ; then
continue
fi
# Patch with positive guards is only pushed if guard is active
if [[ ${#i_posguards} -gt 0 ]] ; then
if [[ ${#${(@M)mqguards:#${(~j,|,)i_posguards}}} -gt 0 ]] ; then
mqunapplied+=( $i_patch )
fi
continue
fi
# If we made it this far the patch isn't guarded and should be pushed
mqunapplied+=( $i_patch )
done < ${mqseriesfile}
fi
if VCS_INFO_hook 'gen-applied-string' "${mqpatches[@]}"; then
(( ${#mqpatches} )) && applied_string=${mqpatches[1]}
else
applied_string=${hook_com[applied-string]}
fi
hook_com=()
if VCS_INFO_hook 'gen-unapplied-string' "${mqunapplied[@]}"; then
unapplied_string=${#mqunapplied}
else
unapplied_string=${hook_com[unapplied-string]}
fi
hook_com=()
if VCS_INFO_hook 'gen-mqguards-string' "${mqguards[@]}"; then
guards_string=${(j:,:)mqguards}
else
guards_string=${hook_com[guards-string]}
fi
if (( ${#mqpatches} )); then
zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" patch-format \
hgmqstring || hgmqstring="%p (%n applied)"
else
zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" nopatch-format \
hgmqstring || hgmqstring="no patch applied"
fi
hook_com=( applied "${applied_string}" unapplied "${unapplied_string}"
applied-n ${#mqpatches} unapplied-n ${#mqunapplied}
guards "${guards_string}" guards-n ${#mqguards} )
if VCS_INFO_hook 'set-patch-format' ${qstring}; then
zformat -f hgmqstring "${hgmqstring}" \
"p:${hook_com[applied]}" "u:${hook_com[unapplied]}" \
"n:${#mqpatches}" "c:${#mqunapplied}" \
"g:${hook_com[guards]}" "G:${#mqguards}"
else
hgmqstring=${hook_com[patch-replace]}
fi
hook_com=()
fi
### Build the misc string
hgmisc+=( ${hgmqstring} )
hgmisc+=( ${hgbmstring} )
backend_misc[patches]="${hgmqstring}"
backend_misc[bookmarks]="${hgbmstring}"
VCS_INFO_formats "${hgactionstring}" "${branchformat}" "${hgbase}" '' "${hgchanges}" "${r_lrev}" "${(j:;:)hgmisc}"
return 0
PK [v*S functions/_uniqnu W+A #compdef uniq
local args
args=(
'(-c --count)'{-c,--count}'[prefix lines by the number of occurrences]'
'(-d --repeated)'{-d,--repeated}'[only print duplicate lines]'
'(-D --all-repeated)'{-D,--all-repeated=}'[print all duplicate lines]:delimit method:(none prepend separate)'
'(-f --skip-fields)'{-f,--skip-fields=}'[avoid comparing initial fields]:number of fields'
'(-i --ignore-case)'{-i,--ignore-case}'[ignore differences in case when comparing]'
'(-s --skip-chars)'{-s,--skip-chars=}'[avoid comparing initial characters]:number of characters'
'(-t --separator)'{-t,--separator=}'[specify field delimiter]:separator'
'(-u --unique)'{-u,--unique}'[only print unique lines]'
'(-w --check-chars)'{-w,--check-chars=}'[specify maximum number of characters to compare]:characters'
'(-W --check-fields)'{-W,--check-fields=}'[specify maximum number of fields to compare]:fields'
'(- *)--help[display help information]'
'(- *)--version[display version information]'
)
if ! _pick_variant gnu=Free\ Soft unix --version; then
args=( ${(M)args:#(|\*)(|\(*\))-[cdufs]*} )
fi
_arguments "$args[@]" \
'1::input file:_files' \
'2::output file:_files'
PK [LQ Q " functions/backward-kill-word-matchnu W+A emulate -L zsh
setopt extendedglob
autoload match-words-by-style
local curcontext=":zle:$WIDGET" word done
local -a matched_words
integer count=${NUMERIC:-1}
if (( count < 0 )); then
(( NUMERIC = -count ))
zle ${WIDGET##backward-}
return
fi
while (( count-- )); do
match-words-by-style
word="$matched_words[2]$matched_words[3]"
if [[ -n $word ]]; then
if [[ -n $done || $LASTWIDGET = *kill* ]]; then
CUTBUFFER="$word$CUTBUFFER"
else
zle copy-region-as-kill -- "$word"
fi
LBUFFER=$matched_words[1]
else
return 1
fi
done=1
done
return 0
PK [2 2 functions/_ifconfignu W+A #compdef ifconfig
local curcontext="$curcontext" state line ret=1
local -a opts args alias debug updownlist
alias=( '(-alias alias)'{,-}'alias[remove or establish alternate address for if]' )
debug=( '(-debug debug)'{,-}'debug[disable or enable debugging code]' )
updownlist=(
'(-a -d -C)-u[restrict to interfaces which are up]'
'(-a -u -C)-d[restrict to interfaces which are down]'
'(-a -C -m -L 1 *)-l[list interfaces]'
)
case $OSTYPE in
darwin*)
args=( -s $updownlist )
opts=(
$alias $debug delete dest_address ipdst nsellength
{,-}trailers {,-}link{0,1,2}
)
;;
freebsd*|dragonfly*)
args=( -s $updown
'(-a -l -u -d -m -L 1 *)-C[list interface cloners]'
'(-l -C)-m[list supported media]'
'(-l -C)-L[show address lifetime as time offset]'
)
opts=( $alias $debug
anycast lladdr media {,-}mediaopt {,delete}tunnel create destroy
{,un}plumb vlan {,-}vlandev metric prefixlen range phase ssid muid
stationname channel authmode {,-}powersave powersavesleep wepmode
{,-}wep {,-}nwkey add delete ether {,-}link{0,1,2}
)
;;
irix5*) opts=( $debug ) ;;
irix6*)
opts=( $debug {-,}highbw {,-}link{0,1,2} primary rspace sspace )
args=( '-w[display additional information]' )
;;
linux*)
opts=(
'(-promisc promisc)'{,-}'promisc[disable or enable promiscuous mode]'
'(-allmulti allmulti)'{,-}'allmulti[disable or enable all-multicast]'
'media[set physical port type]:medium type:(auto 10base2 10baseT AUI)'
'hw[set hardware class]:hardware class:(ether ax25 ARCnet netrom)'
add del dstaddr io_addr irq mem_start multicast pointopoint
tunnel txqueuelen
)
;;
solaris*)
args=(
'-ad[apply to all down interfaces]'
'-adD[apply to all down interfaces not controlled by DHCP]'
'-au[apply to all up interfaces]'
'-auD[apply to all up interfaces not controlled by DHCP]'
)
opts=(
'auto-revarp[use RARP to acquire address]'
{,-}trailers {,-}private {,un}plumb
'(dhcp auto-dhcp)'{,auto-}'dhcp[use dhcp]'
primary wait drop extend ping release start status
)
;;
esac
_arguments -C "$args[@]" \
'-a[apply to all interfaces]' \
'1:network interface:_net_interfaces' \
'::address family:(atalk ether inet inet6 ax25 ddp ipx netrom)' \
'*:option:->options' && ret=0
[[ -n "$state" ]] && _values -S ' ' -w 'option' "$opts[@]" \
'(down)up[activate interface]' \
'(up)down[shut down interface]' \
'(-arp arp)'{,-}'arp[disable or enable address resolution protocol]' \
'metric[set routing metric for interface]:routing metric' \
'mtu[set maximum transfer unit]:mtu' \
'netmask[specify network mask]:netmask' \
'broadcast[specify broadcast address]:broadcast address' \
'address[specify IP address of interface]:IP address' && ret=0
return ret
PK [! functions/_portsnu W+A #autoload
local expl ports
if ! zstyle -a ":completion:${curcontext}:" ports ports; then
(( $+_cache_ports )) ||
: ${(A)_cache_ports:=${${(M)${${(f)"$(