about summary refs log tree commit diff
path: root/Completion/Unix/Command/_texinfo
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2002-08-09 16:04:46 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2002-08-09 16:04:46 +0000
commite7652ce1e60f365af16093b7c270d967bb0a5156 (patch)
treed5c39b2b983d8de21f932fb9545f1121ebe63edd /Completion/Unix/Command/_texinfo
parent5440b945dd3037e48c2b1da8d067460c98053205 (diff)
downloadzsh-e7652ce1e60f365af16093b7c270d967bb0a5156.tar.gz
zsh-e7652ce1e60f365af16093b7c270d967bb0a5156.tar.xz
zsh-e7652ce1e60f365af16093b7c270d967bb0a5156.zip
17522: also handle tkinfo
Diffstat (limited to 'Completion/Unix/Command/_texinfo')
-rw-r--r--Completion/Unix/Command/_texinfo26
1 files changed, 19 insertions, 7 deletions
diff --git a/Completion/Unix/Command/_texinfo b/Completion/Unix/Command/_texinfo
index 35c13c878..5c118f3f0 100644
--- a/Completion/Unix/Command/_texinfo
+++ b/Completion/Unix/Command/_texinfo
@@ -1,13 +1,12 @@
-#compdef info install-info makeinfo texi2dvi texindex
+#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)
-    local -A opt_args
-    local -a info
-    info=(_call_program info ${words[1]})
-
+    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 -/' \
@@ -23,6 +22,8 @@ case $service in
       '--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
@@ -128,14 +129,25 @@ case $service in
       '*: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
 
-    info=($info ${(kv)opt_args[(I)(-d|--directory|-f|--file)]})
-
     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