~reviewer/hello-hut

ref: e9c5dfadb593e1030b54e956c55e0cb43ef2c81d hello-hut/contrib/completions/hello-hut.bash -rw-r--r-- 579 bytes
e9c5dfad — Noor Haddad cli: add --lang to pick the greeting language 22 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# bash completion for hello-hut
# Copy to ~/.local/share/bash-completion/completions/hello-hut

_hello_hut() {
    local cur opts
    cur="${COMP_WORDS[COMP_CWORD]}"
    opts="--shout --time-of-day --count --color --format --version --help"
    case "${COMP_WORDS[COMP_CWORD-1]}" in
        --color) COMPREPLY=($(compgen -W "auto always never" -- "$cur")); return ;;
        --format) COMPREPLY=($(compgen -W "text json" -- "$cur")); return ;;
    esac
    if [[ "$cur" == -* ]]; then
        COMPREPLY=($(compgen -W "$opts" -- "$cur"))
    fi
}
complete -F _hello_hut hello-hut