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.11.5 contrib/completion/td-completion.bash
td-0.11.4 contrib/completion/td-completion.bash
td-0.11.3 contrib/completion/td-completion.bash
td-0.11.2 contrib/completion/td-completion.bash
td-0.11.1 contrib/completion/td-completion.bash
td-0.10.99 contrib/completion/td-comletion.bash
td-0.10.98 contrib/completion/td-comletion.bash
td-0.10.97 contrib/completion/td-comletion.bash
td-0.10.96 contrib/completion/td-comletion.bash
td-0.10.95 contrib/completion/td-comletion.bash
td-0.10.94 contrib/completion/td-comletion.bash
td-0.10.93 contrib/completion/td-comletion.bash
td-0.10.92 contrib/completion/td-comletion.bash
td-0.10.91 contrib/completion/td-comletion.bash
td-0.10.90 contrib/completion/td-comletion.bash
td-0.10.89 contrib/completion/td-comletion.bash
td-0.10.88 contrib/completion/td-comletion.bash
td-0.10.87 contrib/completion/td-comletion.bash
td-0.10.86 contrib/completion/td-comletion.bash
td-0.10.85 contrib/completion/td-comletion.bash