Sha256: 2f16e57a4c4a2957c4876eb88bc54e609f9151b5e1c51212bb1d31006d58ab4a

Contents?: true

Size: 841 Bytes

Versions: 2

Compression:

Stored size: 841 Bytes

Contents

# To get autocompletion functionality
# run: dirtree completion >> ~/.bashrc
# Or, dirtree completion > /usr/local/etc/bash_completion.d/dirtree
#!/usr/bin/env bash

_dirtree_completions()
{
    local cur prev

    cur=${COMP_WORDS[COMP_CWORD]}
    prev="${COMP_WORDS[COMP_CWORD-1]}"
    COMPREPLY=() 
    if [ "${#COMP_WORDS[@]}" != "2" ]; then
        return
    fi
    case "$cur" in
        -*)
        COMPREPLY=( $( compgen -W '-v -h -l -s -o -t \
                               --version --help --local \
                               --screenshot --output --template' -- $cur ) )                           
        ;;
    esac

    if [[ ${prev} == -t ]] || [[ ${prev} == --template ]]; then
        COMPREPLY=( $( compgen -W 'circles flame tree treemap' -- $cur ) )
    fi

    return 0
}

complete -F _dirtree_completions dirtree

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dirtree-1.0.0 exe/dirtree-completion.bash
dirtree-0.6.1 exe/dirtree-completion.bash