__fish_complete_command now can understand '--arg=option' tokens

latexmk completion is updated
This commit is contained in:
maxfl 2012-06-13 17:35:20 +04:00
parent 45b667826f
commit ea74ffa086
2 changed files with 11 additions and 5 deletions

View file

@ -27,7 +27,7 @@ complete -c latexmk -o h -o help -d 'print help'
complete -c latexmk -o jobname= -x -d 'set basename of output file(s) to STRING'
complete -c latexmk -o l -d 'force landscape mode'
complete -c latexmk -o l- -d 'turn off -l'
complete -c latexmk -o latex= -x -d 'set program used for latex'
complete -c latexmk -o latex= -d 'set program used for latex' -xa '(__fish_complete_command)'
complete -c latexmk -o new-viewer -d 'in -pvc mode, always start a new viewer'
complete -c latexmk -o new-viewer- -d 'in -pvc mode, start a new viewer only if needed'
complete -c latexmk -o nobibtex -d 'never use bibtex'
@ -36,7 +36,7 @@ complete -c latexmk -o norc -d 'omit automatic reading of system, user a
complete -c latexmk -o output-directory= -o outdir= -d 'set name of directory for output files' -xa '(__fish_complete_directories)'
complete -c latexmk -o pdf -d 'generate pdf by pdflatex'
complete -c latexmk -o pdfdvi -d 'generate pdf by dvipdf'
complete -c latexmk -o pdflatex= -d 'set program used for pdflatex' -x
complete -c latexmk -o pdflatex= -d 'set program used for pdflatex' -xa '(__fish_complete_command)'
complete -c latexmk -o pdfps -d 'generate pdf by ps2pdf'
complete -c latexmk -o pdf- -d 'turn off pdf'
complete -c latexmk -o ps -d 'generate postscript'

View file

@ -1,4 +1,10 @@
function __fish_complete_command --description "Complete using all available commands"
printf "%s\n" (commandline -ct)(complete -C (commandline -ct))
function __fish_complete_command --description 'Complete using all available commands'
set -l ctoken (commandline -ct)
switch $ctoken
case '*=*'
set ctoken (echo $ctoken | sed 's/=/\n/')
printf '%s\n' $ctoken[1]=(complete -C$ctoken[2])
case '*'
complete -C$ctoken
end
end