Skip to content

Commit 7541547

Browse files
committed
Fix filename completion in bash autocompletion
Bash globbing does not support `|` for alternatives, which meant that the prior pattern would only match file names that contained a `|`.
1 parent 66004dc commit 7541547

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Diff for: scripts/bash-autocomplete/cbmc.sh.template

+11-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ _cbmc_autocomplete()
5454
fi
5555

5656
#if none of the above applies, offer directories and files that we can analyze
57-
COMPREPLY=( $(compgen -G '*.class|*.jar|*.cpp|*.cc|*.c\+\+|*.ii|*.cxx|*.c|*.i|*.gb' -- $cur) )
57+
_filedir -d
58+
COMPREPLY+=( $(compgen -G "$cur*.c") )
59+
COMPREPLY+=( $(compgen -G "$cur*.c\+\+") )
60+
COMPREPLY+=( $(compgen -G "$cur*.cc") )
61+
COMPREPLY+=( $(compgen -G "$cur*.class") )
62+
COMPREPLY+=( $(compgen -G "$cur*.cpp") )
63+
COMPREPLY+=( $(compgen -G "$cur*.cxx") )
64+
COMPREPLY+=( $(compgen -G "$cur*.gb") )
65+
COMPREPLY+=( $(compgen -G "$cur*.i") )
66+
COMPREPLY+=( $(compgen -G "$cur*.ii") )
67+
COMPREPLY+=( $(compgen -G "$cur*.jar") )
5868
}
5969
complete -F _cbmc_autocomplete cbmc

0 commit comments

Comments
 (0)