equal
deleted
inserted
replaced
20 w0=${COMP_WORDS[COMP_CWORD]} |
20 w0=${COMP_WORDS[COMP_CWORD]} |
21 w1=${COMP_WORDS[COMP_CWORD-1]} |
21 w1=${COMP_WORDS[COMP_CWORD-1]} |
22 w2=${COMP_WORDS[COMP_CWORD-2]} |
22 w2=${COMP_WORDS[COMP_CWORD-2]} |
23 w3=${COMP_WORDS[COMP_CWORD-3]} |
23 w3=${COMP_WORDS[COMP_CWORD-3]} |
24 |
24 |
25 DATA_TYPE=( |
25 CONNECTION_OPTIONS=( |
26 "string" |
26 "username" |
27 "integer" |
27 "password" |
28 "boolean" |
|
29 ) |
|
30 |
|
31 BOOLEAN_VALUES=( |
|
32 "true" |
|
33 "false" |
|
34 ) |
28 ) |
35 |
29 |
36 if [[ "$w1" == "--relation" && "x$w0" == "x" ]]; then COMPREPLY=("''") |
30 if [[ "$w1" == "--relation" && "x$w0" == "x" ]]; then COMPREPLY=("''") |
|
31 elif [[ "$w1" == "--connection-string" && "x$w0" == "x" ]]; then COMPREPLY=("'mqtt://localhost:1883'") |
|
32 elif [[ "$w1" == "--connection-option" ]]; then COMPREPLY=($(compgen -W "${CONNECTION_OPTIONS[*]}" -- "$w0")) |
|
33 elif [[ "$w2" == "--connection-option" && "x$w0" == "x" ]]; then COMPREPLY=("''") |
37 elif [[ "$w1" == "--stream" && "x$w0" == "x" ]]; then COMPREPLY=("''") |
34 elif [[ "$w1" == "--stream" && "x$w0" == "x" ]]; then COMPREPLY=("''") |
38 else |
35 else |
39 OPTIONS=( |
36 OPTIONS=( |
40 "--relation" |
37 "--relation" |
|
38 #"--connection-name" |
|
39 "--connection-string" |
|
40 "--connection-option" |
41 "--stream" |
41 "--stream" |
42 ) |
42 ) |
43 COMPREPLY=($(compgen -W "${OPTIONS[*]}" -- "$w0")) |
43 COMPREPLY=($(compgen -W "${OPTIONS[*]}" -- "$w0")) |
44 fi |
44 fi |
45 } |
45 } |