|
1 |
| -# bash completions for the command `ds domains-add` |
2 |
| -_ds_domains-rm() { |
3 |
| - local cur=${COMP_WORDS[COMP_CWORD]} ## $1 |
4 |
| - local domains=$(cat containers.txt | cut -d: -f2) |
5 |
| - COMPREPLY=( $(compgen -W "$domains" -- $cur) ) |
6 |
| -} |
7 |
| - |
8 | 1 | # bash completions for the command `ds domains-add`
|
9 | 2 | _ds_domains-add() {
|
10 |
| - COMPREPLY=() # Array variable storing the possible completions. |
11 |
| - local cur=${COMP_WORDS[COMP_CWORD]} ## $1 |
12 |
| - local prev=${COMP_WORDS[COMP_CWORD-1]} ## $2 |
| 3 | + local containers=$(docker ps -a --format "{{.Names}}") |
| 4 | + COMPREPLY=( $(compgen -W "$containers" -- $1) ) |
| 5 | +} |
13 | 6 |
|
14 |
| - if [[ $COMP_CWORD -eq 2 ]]; then |
15 |
| - local containers=$(docker ps -a --format "{{.Names}}") |
16 |
| - COMPREPLY=( $(compgen -W "$containers" -- $cur) ) |
17 |
| - fi |
| 7 | +# bash completions for the command `ds domains-rm` |
| 8 | +_ds_domains-rm() { |
| 9 | + local domains=$(cat $(_ds_container_dir)/containers.txt | cut -d: -f2) |
| 10 | + COMPREPLY=( $(compgen -W "$domains" -- $1) ) |
18 | 11 | }
|
19 | 12 |
|
20 | 13 | # bash completions for the command `ds get-ssl-cert`
|
21 | 14 | _ds_get-ssl-cert() {
|
22 |
| - COMPREPLY=() # Array variable storing the possible completions. |
23 |
| - local cur=${COMP_WORDS[COMP_CWORD]} ## $1 |
24 |
| - local prev=${COMP_WORDS[COMP_CWORD-1]} ## $2 |
25 |
| - |
26 |
| - if [[ $COMP_CWORD -gt 2 ]]; then |
27 |
| - local domains=$(cat containers.txt | cut -d: -f2) |
28 |
| - COMPREPLY=( $(compgen -W "$domains" -- $cur) ) |
29 |
| - fi |
| 15 | + local domains=$(cat $(_ds_container_dir)/containers.txt | cut -d: -f2) |
| 16 | + COMPREPLY=( $(compgen -W "$domains" -- $1) ) |
30 | 17 | }
|
31 | 18 |
|
32 | 19 | # bash completions for the command `ds sshtunnel-rm`
|
33 | 20 | _ds_sshtunnel-rm() {
|
34 |
| - local cur=${COMP_WORDS[COMP_CWORD]} ## $1 |
35 | 21 | local domains=$(ls sshtunnel-keys/*.key | sed -e 's#sshtunnel-keys/##g' -e 's/.key//g')
|
36 |
| - COMPREPLY=( $(compgen -W "$domains" -- $cur) ) |
| 22 | + COMPREPLY=( $(compgen -W "$domains" -- $1) ) |
37 | 23 | }
|
0 commit comments