From 00002a3e5d742554081a614dc5faa663cfe725b1 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 14 Aug 2002 13:43:54 +0000 Subject: merge back new completion functions from 4.1 branch --- Completion/Unix/Command/.distfiles | 2 +- Completion/Unix/Command/_ant | 38 +++++++++ Completion/Unix/Command/_texinfo | 157 +++++++++++++++++++++++++++++++++++++ 3 files changed, 196 insertions(+), 1 deletion(-) create mode 100644 Completion/Unix/Command/_ant create mode 100644 Completion/Unix/Command/_texinfo (limited to 'Completion/Unix') diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles index 1abbce2d0..c4438c256 100644 --- a/Completion/Unix/Command/.distfiles +++ b/Completion/Unix/Command/.distfiles @@ -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 ' diff --git a/Completion/Unix/Command/_ant b/Completion/Unix/Command/_ant new file mode 100644 index 000000000..c1baf6f69 --- /dev/null +++ b/Completion/Unix/Command/_ant @@ -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/ *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 -- cgit 1.4.1