X-Git-Url: https://git.sthu.org/?p=shuber-gentoo-overlay.git;a=blobdiff_plain;f=dev-tex%2Flatexmk%2Ffiles%2Fcompletion.bash-2;fp=dev-tex%2Flatexmk%2Ffiles%2Fcompletion.bash-2;h=0000000000000000000000000000000000000000;hp=a24b7a819156bc61546572b7eef6eedfcc00722f;hb=73fa44dbd16d18877a0a938e8dbb6bd1510a263e;hpb=e321daccb025cdddaffc2954025bac555fd7c49f diff --git a/dev-tex/latexmk/files/completion.bash-2 b/dev-tex/latexmk/files/completion.bash-2 deleted file mode 100644 index a24b7a8..0000000 --- a/dev-tex/latexmk/files/completion.bash-2 +++ /dev/null @@ -1,45 +0,0 @@ -#! /bin/bash - -# 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, or (at your option) -# any later version. - -# bash_completion for latexmk -# -# -# Author: Christoph Junghans -# ottxor@gentoo.org -# -# Revision history: -# 0.1 26-05-10 --- initial version -# 0.2 15-02-11 --- clean up -# -# HOWTO: -# source this file to enable it - -_latexmk() -{ - local cur output aopts opts prev - cur=${COMP_WORDS[COMP_CWORD]} - prev=${COMP_WORDS[COMP_CWORD-1]} - - output=$( $1 -help 2> /dev/null) - #options with args ,pattern: ^ (-XXX) .*$ - aopts=" $( echo " $output" | sed -n 's/^[[:space:]]\+\(-[^[:space:]]\+\)[[:space:]]\+<[^>]\+>.*$/\1/p' | sort -u | tr '\n' ' ')" - #if previous option in in $aopts - if [[ -n "$prev" ]] && [[ -z "${aopts//* $prev *}" ]]; then - #argument of $prev ,pattern: ^ -XXX ().*$ - opts=$(echo "$output" | sed -n "s/^[[:space:]]\+$prev[[:space:]]\+\(<[^>]\+>\).*\$/\1/p") - COMPREPLY=( $( compgen -W '$opts' -- $cur ) ) - elif [[ "$cur" == -* ]]; then - #all options, pattern: ^ (-XXX).*$ - opts=$( echo "$output" | sed -n 's/^[[:space:]]\+\(-[^[:space:]]\+\).*$/\1/p'| sort -u ) - COMPREPLY=( $( compgen -W '$opts' -- $cur ) ) - else - #filenames *.tex and dirs, rest is done by '-o filenames' below - COMPREPLY=( $( eval compgen -f -X "!*.tex" -- ${cur} ) $( compgen -d -- $cur ) ) - fi -} - -complete -F _latexmk -o filenames latexmk