Hello, I’m working on adding spring-boot-cli to nixpkgs here. Everything works except shell completion. In the completion file the spring command is used. How can I use the spring command in a bash-completion file?
1 # bash completion for spring
2 # Installation: source this file locally in a terminal or from
3 # ~/.bashrc or put it in /etc/bash_completions.d (debian)
4
5 _spring()
6 {
7 local cur prev help helps words cword command commands i
8
9 _get_comp_words_by_ref cur prev words cword
10
11 COMPREPLY=()
12
13 while read -r line; do
14 reply=`echo "$line" | awk '{print $1;}'`
15 COMPREPLY+=("$reply")
16 done < <(spring hint ${cword} ${words[*]})
17
18 if [ $cword -ne 1 ]; then
19 _filedir
20 fi
21
22 } && complete -F _spring spring
Line 16 uses the spring command that is installed by the package.