1 2 3 4 5 6 7 8 9 10 11
function _pyxstitch() { local cur opts if [ $COMP_CWORD -eq 1 ]; then cur=${COMP_WORDS[COMP_CWORD]} opts=$(pyxstitch --help | sed "s/^\s*//g;s/, //g;s/^-h//g" | grep "^\-" | cut -d " " -f 1) COMPREPLY=( $(compgen -W "$opts" -- $cur) ) fi } complete -F _pyxstitch pyxstitch