Sha256: 2596b48916b4c90c3fad002c5bb3908a1405fc8aff8ab5f58f0bf0760b9e9169

Contents?: true

Size: 652 Bytes

Versions: 70

Compression:

Stored size: 652 Bytes

Contents

# bash completion for td commands

_td()
{
    COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
    local cur="${COMP_WORDS[COMP_CWORD]}"
    local prev="${COMP_WORDS[COMP_CWORD - 1]}"
    local list="`td help:all | awk '{print $1}' | grep '^[a-z]' | xargs`"

    # echo "cur=$cur, prev=$prev"

    if [[ "$prev" == "td" ]]; then
        if [[ "$cur" == "" ]]; then
            COMPREPLY=($list)
        else
            COMPREPLY=($(compgen -W "$list" -- "$cur"))
        fi
    fi
}
complete -F _td td

# Local variables:
# # mode: shell-script
# # sh-basic-offset: 4
# # sh-indent-comment: t
# # indent-tabs-mode: nil
# # End:
# # ex: ts=4 sw=4 et filetype=sh

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
td-0.17.1 contrib/completion/td-completion.bash
td-0.17.0 contrib/completion/td-completion.bash
td-0.16.10 contrib/completion/td-completion.bash
td-0.16.9 contrib/completion/td-completion.bash
td-0.16.8 contrib/completion/td-completion.bash
td-0.16.7 contrib/completion/td-completion.bash
td-0.16.6 contrib/completion/td-completion.bash
td-0.16.5 contrib/completion/td-completion.bash
td-0.16.4 contrib/completion/td-completion.bash
td-0.16.3 contrib/completion/td-completion.bash
td-0.16.1 contrib/completion/td-completion.bash
td-0.16.0 contrib/completion/td-completion.bash
td-0.15.9 contrib/completion/td-completion.bash
td-0.15.8 contrib/completion/td-completion.bash
td-0.15.7 contrib/completion/td-completion.bash
td-0.15.6 contrib/completion/td-completion.bash
td-0.15.5 contrib/completion/td-completion.bash
td-0.15.4 contrib/completion/td-completion.bash
td-0.15.3 contrib/completion/td-completion.bash
td-0.15.2 contrib/completion/td-completion.bash