forked from parapluu/Concuerror
-
Notifications
You must be signed in to change notification settings - Fork 0
/
concuerror
61 lines (57 loc) · 2.32 KB
/
concuerror
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# bash_completion for concuerror
# To use it, you can either:
# - Link the file to e.g. `/etc/bash_completion.d`
# - Run `. /path-to-the-file`, if you want to use it only for the current shell session
# - Add `[ -s "/path-to-the-file" ] && \. "/path-to-the-file"` to your e.g. `.bashrc` file
_concuerror()
{
# Keep this sorted alphabetically
long_opts="--after_timeout --assertions_only --assume_racing --depth_bound
--disable_sleep_sets --dpor --exclude_module --file --first_process_errors_only
--graph --help --ignore_error --instant_delivery --interleaving_bound --keep_going
--log_all --module --no_output --non_racing_system --observers --optimal --output --pa
--print_depth --pz --quiet --scheduling --scheduling_bound --scheduling_bound_type
--show_races --strict_scheduling --symbolic_names --test --timeout --treat_as_normal
--use_receive_patterns --verbosity --version"
# Keep this sorted alphabetically
opts="-a -b -c -d -f -g -h -i -k -m -o -q -s -t -v -x"
local cur prev
if type _get_comp_words_by_ref &>/dev/null ; then
_get_comp_words_by_ref cur prev
else
cur=$2 prev=$3
fi
case $prev in
--dpor)
COMPREPLY=($(compgen -W "none optimal persistent source" -- ${cur}))
;;
-f|--file|--pa|--pz)
_filedir
;;
-h|--help)
help_args="all attributes progress"
keywords="advanced basic bound console erlang errors experimental input output por visual"
COMPREPLY=($(compgen -W "${help_args} ${keywords}" -- ${cur}))
;;
-c|--scheduling_bound_type)
COMPREPLY=($(compgen -W "bpor delay none ubpor" -- ${cur}))
;;
--scheduling)
COMPREPLY=($(compgen -W "newest oldest round_robin" -- ${cur}))
;;
-a|--after_timeout|-i|--interleaving_bound|--timeout)
COMPREPLY=($(compgen -W "infinity" -- ${cur}))
;;
*)
if [[ ${cur} == --* ]] ; then
COMPREPLY=($(compgen -W "${long_opts}" -- ${cur}))
elif [[ ${cur} == -* ]] ; then
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
else
_filedir
fi
;;
esac
}
complete -F _concuerror concuerror