have lliurex-maker && _lliurex_maker() { local cur prev opts base COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" # # The basic options we'll complete. # opts="build clean" # # Complete the arguments to some of the basic commands. # case "${prev}" in build) local running=$( ls /etc/live/build.d/ ) COMPREPLY=( $(compgen -W "${running}" -- ${cur}) ) return 0 ;; *) ;; esac COMPREPLY=($(compgen -W "${opts}" -- ${cur})) return 0 } [ "$have" ] && complete -F _lliurex_maker lliurex-maker