1 # TLD Linux builder(1) script completion
3 # get active spec file from commandline
4 # caller should make $spec local variable
5 # TODO: it gets it wrong if some option arg is found before spec itself
10 for (( i=1; i < ${#words[@]}-1; i++ )); do
11 if [[ ${words[i]} != -* ]]; then
16 [[ ! -f $spec ]] && return 0
21 local cur prev words cword
22 _init_completion || return
26 COMPREPLY=( $( compgen -W '$( git tag )' -- "$cur" ) )
34 /^%changelog/ { exit }
39 COMPREPLY=( $( compgen -W "$bconds" -- "$cur" ) )
44 if [[ $cur == -* ]]; then
45 COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
50 complete -F _builder builder