We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8729d81 commit cf2f6e5Copy full SHA for cf2f6e5
bake-completion.sh
@@ -1,10 +1,14 @@
1
#!/usr/bin/env bash
2
3
_bake () {
4
- local cur
5
- _get_comp_words_by_ref -n : -c cur
6
- local tasks="$(bake | grep -v BAKEFILE | grep '^ ' | sed 's/^ //g' | cut -f1 -d' ')"
7
- COMPREPLY=( $(compgen -W "$tasks" -- $cur) )
+ local cword cur tasks
+ _get_comp_words_by_ref -n : -c cur cword
+ tasks="$(bake | grep -v BAKEFILE | grep '^ ' | sed 's/^ //g' | cut -f1 -d' ')"
+ if [[ "$cword" -eq "1" ]]; then
8
+ mapfile -t COMPREPLY < <(compgen -W "$tasks" -- "$cur")
9
+ else
10
+ mapfile -t COMPREPLY < <(compgen -o default -- "$cur")
11
+ fi
12
13
# NB: this is a workaround for bash's default of splitting words on colons
14
# when bake tasks also use colons as a namespace separator. What we need to
0 commit comments