Skip to content
Snippets Groups Projects
Commit b186aab0 authored by Lionel Blatter's avatar Lionel Blatter
Browse files

Add full completion for "-wp-prover"

Fix typos
parent 8e4f5f0c
No related branches found
No related tags found
No related merge requests found
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
# If you want to enable Frama-C completion only for your account, append # If you want to enable Frama-C completion only for your account, append
# this file to ~/.bash_completion. # this file to ~/.bash_completion.
# #
# For a less verbose completition for options with comma-separated values, # For a less verbose completion for options with comma-separated values,
# put "set show-all-if-ambiguous on" in your "~/.inputrc". # put "set show-all-if-ambiguous on" in your "~/.inputrc".
# #
# Assuming frama-c is in your PATH, # Assuming frama-c is in your PATH,
...@@ -93,14 +93,13 @@ _frama-c () ...@@ -93,14 +93,13 @@ _frama-c ()
elif [[ "${COMP_WORDS[COMP_CWORD -1]}" == "-wp-prover" ]] elif [[ "${COMP_WORDS[COMP_CWORD -1]}" == "-wp-prover" ]]
then then
local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*},"
# The current output of -wp-detect is not suitable for an easy grep using regular expressions, advance_options="$(frama-c -wp-detect | grep -E -o " \[.*" | grep -E -o "[^\[-\|]*")"
# so the possible completions are not added to $COMPREPLY.
advance_options="none scritp tip alt-ergo altgr-ergo coq native:alt-ergo native:coq native:coqide"
local ambigous="$(bind -v | grep show-all-if-ambiguous)" local ambigous="$(bind -v | grep show-all-if-ambiguous)"
ambigous="${ambigous##* }" ambigous="${ambigous##* }"
if [[ "$ambigous" == "on" ]] if [[ "$ambigous" == "on" ]]
then then
COMPREPLY=( $( compgen -W "${advance_options}" -- "${cur##*,}" ) ) COMPREPLY=( $( compgen -W "${advance_options}" -- "${cur##*,}" ) )
COMPREPLY+=( $( compgen -W "none script tip native:alt-ergo native:coq native:coqide" -- "${cur##*,}" ) )
[[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} ) [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} )
else else
COMPREPLY=( $( compgen -P "$prefix" -W "${advance_options}" -- "${cur##*,}" ) ) COMPREPLY=( $( compgen -P "$prefix" -W "${advance_options}" -- "${cur##*,}" ) )
......
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