diff options
author | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2020-08-03 18:43:13 -0300 |
---|---|---|
committer | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2020-08-03 18:43:13 -0300 |
commit | 95623d39d6029ba78ec96ad5ea08e9ac12629b91 (patch) | |
tree | ea0fe36eb5e6f40e0a1f765d44c4b0c0b2bfb089 /completions/povray | |
parent | 019f3cc463db63abc6460f97deb488deec43840b (diff) | |
download | bash-completion-95623d39d6029ba78ec96ad5ea08e9ac12629b91.tar.gz |
New upstream version 2.11upstream/2.11upstream
Diffstat (limited to 'completions/povray')
-rw-r--r-- | completions/povray | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/completions/povray b/completions/povray index c5af018a..56dfd94d 100644 --- a/completions/povray +++ b/completions/povray @@ -16,35 +16,41 @@ _povray() cur="${povcur#[-+]I}" # to confuse _filedir pfx="${povcur%"$cur"}" _filedir pov - COMPREPLY=( ${COMPREPLY[@]/#/$pfx} ) + COMPREPLY=(${COMPREPLY[@]/#/$pfx}) return ;; [-+]O*) # guess what output file type user may want - case $(IFS=$'\n'; command grep '^[-+]F' <<<"${words[*]}") in + case $( + IFS=$'\n' + command grep '^[-+]F' <<<"${words[*]}" + ) in [-+]FN) oext=png ;; [-+]FP) oext=ppm ;; [-+]F[CT]) oext=tga ;; *) oext=$defoext ;; esac # complete filename corresponding to previously specified +I - COMPREPLY=( $(IFS=$'\n'; command grep '^[-+]I' <<<"${words[*]}") ) - COMPREPLY=( ${COMPREPLY[@]#[-+]I} ) - COMPREPLY=( ${COMPREPLY[@]/%.pov/.$oext} ) + COMPREPLY=($( + IFS=$'\n' + command grep '^[-+]I' <<<"${words[*]}" + )) + COMPREPLY=(${COMPREPLY[@]#[-+]I}) + COMPREPLY=(${COMPREPLY[@]/%.pov/.$oext}) cur="${povcur#[-+]O}" # to confuse _filedir pfx="${povcur%"$cur"}" _filedir $oext - COMPREPLY=( ${COMPREPLY[@]/#/$pfx} ) + COMPREPLY=(${COMPREPLY[@]/#/$pfx}) return ;; - *.ini\[|*.ini\[*[^]]) # sections in .ini files + *.ini\[ | *.ini\[*[^]]) # sections in .ini files cur="${povcur#*\[}" pfx="${povcur%\["$cur"}" # prefix == filename [[ -r $pfx ]] || return - COMPREPLY=( $(command sed -e 's/^[[:space:]]*\[\('"$cur"'[^]]*\]\).*$/\1/' \ - -e 't' -e 'd' -- "$pfx") ) + COMPREPLY=($(command sed -e 's/^[[:space:]]*\[\('"$cur"'[^]]*\]\).*$/\1/' \ + -e 't' -e 'd' -- "$pfx")) # to prevent [bar] expand to nothing. can be done more easily? - COMPREPLY=( "${COMPREPLY[@]/#/${pfx}[}" ) + COMPREPLY=("${COMPREPLY[@]/#/${pfx}[}") return ;; *) @@ -53,6 +59,6 @@ _povray() ;; esac } && -complete -F _povray povray xpovray spovray + complete -F _povray povray xpovray spovray # ex: filetype=sh |