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.15.0 contrib/completion/td-completion.bash
td-0.14.1 contrib/completion/td-completion.bash
td-0.14.0 contrib/completion/td-completion.bash
td-0.13.2 contrib/completion/td-completion.bash
td-0.13.1 contrib/completion/td-completion.bash
td-0.13.0 contrib/completion/td-completion.bash
td-0.12.0 contrib/completion/td-completion.bash
td-0.11.14 contrib/completion/td-completion.bash
td-0.11.13 contrib/completion/td-completion.bash
td-0.11.12 contrib/completion/td-completion.bash
td-0.11.11.2 contrib/completion/td-completion.bash
td-0.11.11.1 contrib/completion/td-completion.bash
td-0.11.11 contrib/completion/td-completion.bash
td-0.11.10 contrib/completion/td-completion.bash
td-0.11.9 contrib/completion/td-completion.bash
td-0.11.8.2 contrib/completion/td-completion.bash
td-0.11.8.1 contrib/completion/td-completion.bash
td-0.11.8 contrib/completion/td-completion.bash
td-0.11.7 contrib/completion/td-completion.bash
td-0.11.6 contrib/completion/td-completion.bash