File tree 2 files changed +22
-4
lines changed
scripts/bash-autocomplete
2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 1
1
# CBMC Autocomplete Scripts for Bash
2
2
This directory contains an autocomplete script for bash.
3
- ## Installation
3
+
4
+ ## Installation for bash
4
5
1 . Compile cbmc and
5
6
6
7
2 . ` cd scripts/bash-autocomplete `
7
8
8
9
3 . ` ./extract-switches.sh `
9
10
10
- 4 . Put the following at the end of you in your ` ~/.bashrc ` , with the directories adapted to your directory structure:
11
+ 4 . Put the following at the end of your ` ~/.bashrc ` , with the directories adapted to your directory structure:
11
12
``` bash
12
13
cbmcautocomplete=~ /diffblue/cbmc/scripts/bash-autocomplete/cbmc.sh
13
14
if [ -f $cbmcautocomplete ]; then
14
15
. $cbmcautocomplete
15
16
fi
16
17
```
18
+
19
+ 5. ` source ~ /.bashrc`
20
+
21
+ # # Installation for zsh
22
+ Follow 1. 2. and 3. as above.
23
+
24
+ 4. Put the following at the end of your ` ~/.zshrc` , with the directories adapted to your directory structure:
25
+ ` ` ` bash
26
+ autoload bashcompinit
27
+ bashcompinit
28
+ cbmcautocomplete=~ /diffblue/cbmc/scripts/bash-autocomplete/cbmc.sh
29
+ if [ -f $cbmcautocomplete ]; then
30
+ . $cbmcautocomplete
31
+ fi
32
+ ` ` `
33
+ 5. ` source ~ /.zshrc`
34
+
17
35
# # Usage
18
36
As with the usual autocomplete in bash, start typing a switch to complete it, for example:
19
37
```
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ _cbmc_autocomplete()
26
26
-I|--classpath|-cp|--outfile|--existing-coverage|--graphml-cex)
27
27
# a switch that takes a file parameter of which we don't know an extension
28
28
# TODO probably we can do more for -I, --classpath, -cp
29
- _filedir
29
+ COMPREPLY=( $( compgen -f -- $cur ) )
30
30
return 0
31
31
;;
32
32
esac
@@ -38,6 +38,6 @@ _cbmc_autocomplete()
38
38
fi
39
39
40
40
# if none of the above applies, offer directories and files that we can analyze
41
- _filedir " @( class|jar|cpp|cc|c\+\+|ii|cxx|c|i|gb) "
41
+ COMPREPLY=( $( compgen -G ' *. class|*. jar|*. cpp|*. cc|*. c\+\+|*. ii|*. cxx|*.c|*.i|*.gb ' -- $cur ) )
42
42
}
43
43
complete -F _cbmc_autocomplete cbmc
You can’t perform that action at this time.
0 commit comments