1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-16 12:21:18 +02:00

merge back new completion functions from 4.1 branch

This commit is contained in:
Oliver Kiddle 2002-08-14 13:43:54 +00:00
parent defb497957
commit 00002a3e5d
7 changed files with 237 additions and 4 deletions

View file

@ -1,3 +1,15 @@
2002-08-14 Oliver Kiddle <opk@zsh.org>
* 16000, 16393 (Clint): Completion/Debian/Command/_debchange,
Completion/Debian/Command/_apt-show-versions: merge new Debian
completions from 4.1 branch
* 17125 (Andrej), 17245: Completion/Unix/Command/_texinfo:
merge texinfo completion from 4.1 branch
* 17521: Completion/Unix/Command/_ant,
Completion/Unix/Command/.distfiles: new completion for ant
2002-08-14 Peter Stephenson <pws@csr.com>
* unposted: Config/version.mk: version 4.0.6.

View file

@ -1,8 +1,7 @@
DISTFILES_SRC='
.distfiles
_apt
_apt _apt-show-versions _auto-apt
_bts _bug
_dpkg _dpkg_source _dput _dupload
_debchange _dpkg _dpkg_source _dput _dupload
_update-alternatives _make-kpkg _debfoster
_auto-apt
'

View file

@ -0,0 +1,12 @@
#compdef apt-show-versions
_arguments \
'(--status-file -stf)'{--status-file=,-stf}'[specify dpkg status file]:status file:_files' \
'(--list-dir -ld)'{--list-dir=,-ld}"[specify dir for apt's list files]:apt list dir:_files -/" \
'(--package -p)'{--package=,-p}'[restrict to specified package]:package:_deb_packages avail' \
'(--regex -r)'{--regex,-r}'[interpret -p argument as regex]' \
'(--upgradeable -u)'{--upgradeable,-u}'[print only upgradeable packages]' \
'(--allversions -a)'{--allversions,-a}'[print all available versions]' \
'(--brief -b)'{--brief,-b}'[brief output]' \
'(--verbose -v)'{--verbose,-v}'[verbose output]' \
'(--help -h)'{--help,-h}'[display help information]'

View file

@ -0,0 +1,15 @@
#compdef debchange dch=debchange
_arguments \
'(--help)-h[help]' \
'(-h)--help' \
'--version' \
'(--append -a --newversion -v --increment)-i[increment]' \
'(--append -a --newversion -v -i)--increment' \
'(--increment -i --newversion -v --append)-a[append]' \
'(--increment -i --newversion -v -a)--append' \
'(--append -a --increment -i --newversion)-v[newversion]:version:' \
'(--append -a --increment -i -v)--newversion:version:' \
'(--preserve)-p[preserve]' \
'(-p)--preserve' \
':text:'

View file

@ -16,6 +16,6 @@ _dict _grep _lzop _prcs _tiff _elm
_diff _gs _make _psutils _tin _apm _mail
_loadkeys _modutils _ruby _samba _sysctl _links
_user_admin _rsync _arping _spamassassin _mtools _fsh
_chkconfig _cdcd _irssi _sccs
_chkconfig _cdcd _irssi _sccs _texinfo _ant
_global _global_tags _figlet _ifconfig _last
'

View file

@ -0,0 +1,38 @@
#compdef ant -value-,ANT_ARGS,-default-
typeset -A opt_args
local state line curcontext="$curcontext"
local target='*:target:->target'
if [[ $service = *ANT_ARGS* ]]; then
compset -q
words=( fake "$words[@]" )
(( CURRENT++ ))
unset target
fi
_arguments -C \
'-help[display usage information]' \
'-projecthelp[print project hjelp information]' \
'-version[display version information]' \
'-diagnostics[display info useful to problem diagnosis]' \
'(-q -quiet)'{-q,-quiet}'[be extra quiet]' \
'(-v -verbose)'{-v,-verbose}'[be more verbose]' \
'-debug[print debugging information]' \
'-emacs[produce logging information without adornments]' \
'(-l -logfile)'{-l,-logfile}'[use specified file for log]:logfile:_files' \
'-logger[the class which is to perform logging]:classname:_java_class' \
'-listener[add an instance of class as a project listener]:classname:_java_class' \
'(-f -file -buildfile)'{-f,-file,-buildfile}'[use specified build file]:build file:_files' \
'*-D[specify property with value to use]:property' \
'-propertyfile[load properties from specfied file]:property file:_files' \
'-inputhandler[specify class which will handle input requests]:class:_java_class' \
'-find[search for buildfile]:file:_files' \
$target && return
if [[ -n $state ]]; then
targets=( $(sed -n 's/ *<target name="\([^"]*\)".*/\1/p' < build.xml) )
# ant can be used to get a list of targets for us like this but it is slow
# targets=( ${${(M)${(f)"$(_call_program targets $words[1] -projecthelp)"}:# *}# } )
_wanted targets expl target compadd -a targets
fi

View file

@ -0,0 +1,157 @@
#compdef info tkinfo install-info makeinfo texi2dvi texindex
local curcontext="$curcontext" state line ret=1
local -A opt_args
local -a info
case $service in
info)
info=( _call_program info ${words[1]} )
_arguments -C -s \
'(: -)--apropos=[look up string in indices]:search string: ' \
'(-f --file)'{\*-d,\*--directory=}'[add directory to infopath]:info dir:_files -/' \
'--dribble=[record keystrokes]:file with keystrokes:_files' \
'(-f --file -d --directory)'{-f,--file=}'[info file to show]:info file:_files -g "*.info(|.gz|.bz2)"' \
'(: - -h --help)'{-h,--help}'[display usage]' \
'(-o --output -O)--index-search=[go directly to node if found]:search string: ' \
'(--index-search -o --output -O)'{-o,--output=}'[dump selected nodes to filename]:filename:_files -g "*(^/)"' \
'(-R --raw-escapes)'{-R,--raw-escapes}'[do not remove ANSI escapes from man pages]' \
'--restore=[read keystrokes from file]:filename:_files -g "*(^/)"' \
'(--index-search -o --output -O --show-options --usage)'{-O,--show-options,--usage}'[go to command-line options node]' \
'--subnodes[recursively output menu items]' \
'--vi-keys[use Vi-like key bindings]' \
'(: -)--version[display version information]' \
'(--apropos -h --help -O --output --version)*::menu items:->item' && ret=0
info=( $info {(kv)opt_args[(I)(-d|--directory|-f|--file)]} )
;;
install-info)
if _pick_variant debian=Debian gnu --version; then
_arguments -S \
'(* -)--help[display help information]' \
'(* -)--version[display version information]' \
'(--maxwidth --align --calign)--remove[delete existing entries]' \
'(--maxwidth --align --calign)--remove-exactly[delete existing entries taking exact entry name]' \
'--section[specify section to add entry in]:regexp::title' \
'--infodir=[specify directory containing dir file]:info directory:_files -/' \
'--align=[specify minimum indentation for description]:indentation' \
'--calign=[specify minimum indentation for continuation lines of description]:indentation' \
'--maxwidth=[specify maximim width of dir file]:width' \
'--quiet[suppress informational output]' \
'--description=[specify description for menu entry]:description' \
'--menuentry=[specify the menu entry for dir file]:menu entry' \
'--keep-old=[inhibit replacement of existing entries/removal of empty sections]' \
'--test[do not update dir file]' \
'--debug[enable debugging]' \
'*:info file:_files -g \*.info'
return
else
_arguments \
'(--delete --remove)'{--delete,--remove}'[delete existing entries]' \
'(2)--dir-file=[specify dir file]:dir file:_files -g dir' \
\*{--entry,--info}'[specify directory entry to add]:text' \
'(- 1 2)--help[display help information]' \
'(1)--info-file=[specify info file to install in the directory]:info file:_files -g *.info' \
'(2)--info-dir=[specify directory containing dir file]:info directory:_files -/' \
'--quiet[suppress warnings]' \
'(--delete --remove)--section=[put new entries in specified section]' \
'(- 1 2)--version[display version information]' \
'1:info file:_files -g \*.info' \
'2:dir file:_files -g dir'
return
fi
;;
makeinfo)
_arguments -s \
'--error-limit=[specify number of errors to quit after]:number' \
'--force[preserve output even if errors]' \
'(* -)--help[display help]' \
'--no-validate[suppress node cross-reference validation]' \
'--no-warn[suppress warnings]' \
'--reference-limit=[warn about at most specified number of references]:number' \
'(-v --verbose)'{-v,--verbose}'[explain what is being done]' \
'(* -)--version[display version info]' \
'(--html --xml)--docbook[output in DocBook format]' \
'(--docbook --xml)--html[output in HTML format]' \
'--no-headers[suppress node separators and menus]' \
'(--docbook --html)--xml[output in XML (TexinfoML) format]' \
'(-E --macro-expand)'{-E,--macro-expand}'[output macro-expanded source to specified file]:file:_files' \
'(--docbook --xml)--no-split[suppress splitting of output]' \
'--number-sections[output chapter and section numbers]' \
'(-o --output=)'{-o,--output}'[specify output file]:output file:_files' \
'(--docbook --html --xml)--enable-encoding[output special characters]' \
'(--docbook --html --xml)--fill-column=[specify width to break lines at]:width' \
'(--docbook --html --xml)--footnote-style=[specify style for output of footnotes]:((separate\:in\ own\ node end\:at\ end\ of\ node))' \
'(--docbook --html --xml)--paragraph-indent=[specify spaces to indent paragraphs by]' \
'(--docbook --html --xml)--split-size=[split Info files at specified size]:size' \
'--commands-in-node-names[allow @ commands in node names]' \
'-D[define variable]:variable' \
'-I[specify directory to append to @include search path]:directory:_files -/' \
'-P[specify directory to prepend to @include search path]:directory:_files -/' \
'-U[undefine variable]:variable' \
'(--html --no-ifhtml)--ifhtml[process @ifhtml and @html when not generating HTML]' \
'(--no-ifinfo)--ifinfo[process @ifinfo even when not generating Info]' \
'(--no-iftex)--iftex[process @iftex and @tex text]' \
'(--no-ifplaintext)--ifplaintext[process @ifplaintext even when not generating plain text]' \
'(--ifhtml)--no-ifhtml[do not process @ifhtml and @html text]' \
'(--ifinfo)--no-ifinfo[do not process @ifinfo text]' \
'(--ifplaintext)--no-ifplaintext[do not process @ifplaintext text]' \
'(--iftex)--no-iftex[do not process @iftex and @tex text]' \
'*:texinfo file:_texi'
return
;;
texi2dvi)
_arguments -s \
'(-b --batch)'{-b,--batch}'[no interaction]' \
'(-c --clean)'{-c,--clean}'[remove all auxiliary files]' \
'(-D --debug)'{-D,--debug}'[turn on shell debugging (set -x)]' \
'(- *)'{-h,--help}'[display help information]' \
'(-o --output)'{-o,--output=}'[specify output file]:output file:_files' \
'(-q -s --quiet --silent -V --verbose)'{-q,-s,--silent,--quiet}'[no output except errors]' \
'(-q -s --quiet --silent -V --verbose)'{-V,--verbose}'[report on what is done]' \
'(- *)'{-v,--version}'[display version information]' \
'-@[use @input instead of \input; for preloaded Texinfo]' \
'(-e --expand)'{-e,--expand}'[force macro expansion using makeinfo]' \
'-I[specify search dir for texinfo files]:directory:_files -/' \
'(-l --language)'{-l,--language}'[specify language of input file]:language:(LaTeX Texinfo)' \
'(-p --pdf)'{-p,--pdf}'[use pdftex or pdflatex for processing]' \
\*{-t,--texinfo}'[specify command to insert after @setfilename]:command' \
'*:file:_texi'
return
;;
texindex)
_arguments \
'(* -)--help[display help]' \
'(* -)--version[display version info]' \
'(--no-keep)--keep[keep temporary files around after processing]' \
'(--keep)--no-keep[do not keep temporary files (default)]' \
'(-o --output)'{-o,--output=}'[specify output file]:file:_files' \
'*:texinfo file:_texi'
return
;;
tkinfo)
_x_arguments -C \
'-+'{headers,buttons,balloons,scrollthrough,pagesep,showdir} \
'-linklook:menu display:(color font underline)' \
'-highlight:link display:(color inverse underline)' \
'-searchlook:search match display:(color inverse underline)' \
'-iconic' \
'-dir:info path:_dir_list' \
'-file:info file:_files -g "*.info(|.gz|.bz2)"' \
'-node:info node:->item' \
'*::menu items:->item' && ret=0
info=( _call_program info info ${(kv)opt_args[(I)-file]/-file/-f} )
;;
esac
case $state in
item )
local -a items
items=(${${(M)${${(f)"$(${info} --output - ${words[1,CURRENT-1]} 2>/dev/null)"}[1,(r)[[:space:]]#--- The Detailed Node Listing ---[[:space:]]#]}:#\* *~\* Menu:*}:/(#b)\*[[:space:]]##([^:]##):(#B)( \(?##\)[^.]#.|(:|))[[:space:]]#(#b)(*)[[:space:]]#/$match[1]${match[2]:+:}$match[2]})
_describe -t items "menu items" items && ret=0
;;
esac
return ret