6

Help with bash autocompletion script

view full story
linux-howto

http://www.unix.com – Hello there! I want my program to use the autocompletion functions of bash, and that's what I've tried so far: Code: _myprogram() {     local cur prev opts     COMPREPLY=()     cur="${COMP_WORDS[COMP_CWORD]}"     prev="${COMP_WORDS[COMP_CWORD-1]}"     opts="--picofday --picofday_w8 --constant --pause --next --previous --once --constant --earth --earth_w8 --earth_unity --picofday --picofday_w8 --stop --help"     if [[ ${cur} == -* ]] ; then         COMPREPLY=( $(compgen (HowTos)