Skip to content
Snippets Groups Projects
Commit 7d717f03 authored by Basile Desloges's avatar Basile Desloges
Browse files

[eacsl] Fix bash completions script

parent da05af90
No related branches found
No related tags found
No related merge requests found
...@@ -23,10 +23,8 @@ ...@@ -23,10 +23,8 @@
# Bash completion for e-acsl-gcc.sh # Bash completion for e-acsl-gcc.sh
_eacsl_gcc() { _eacsl_gcc() {
local cur prev opts base local cur prev words cwords opts
COMPREPLY=() _init_completion || return
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts=" opts="
-C -d -o -O -v -V -f -E -L -M -l -e -g -q -s -F -m -D -I -G -X -a -C -d -o -O -v -V -f -E -L -M -l -e -g -q -s -F -m -D -I -G -X -a
...@@ -47,20 +45,19 @@ _eacsl_gcc() { ...@@ -47,20 +45,19 @@ _eacsl_gcc() {
--with-dlmalloc --dlmalloc-from-sources --dlmalloc-compile-only --with-dlmalloc --dlmalloc-from-sources --dlmalloc-compile-only
--dlmalloc-compile-flags --odlmalloc" --dlmalloc-compile-flags --odlmalloc"
case ${prev} in if [[ $cur == = ]]; then
-*) # We just found an option that ends with '=', reset the 'cur' variable
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) # and use files and directories completions
return 0 cur=
;; _filedir
*) elif [[ $cur != -* ]]; then
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) # We are not adding a parameter, use files and directories completions
[[ $COMPREPLY == *= ]] && compopt -o nospace _filedir
return 0 else
;; # We started an option, use e-acsl-gcc completions
esac COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
# If the option ends with '=', do not add a space after the option
return 0 [[ $COMPREPLY == *= ]] && compopt -o nospace
} fi
complete -F _eacsl_gcc e-acsl-gcc.sh } &&
complete -F _eacsl_gcc e-acsl-gcc.sh
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment