summaryrefslogtreecommitdiffstats
path: root/completions/medusa
blob: 347879ac7f9878bc92fdf1f9dd0776e4dba35e66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# bash completion for medusa                               -*- shell-script -*-

_comp_cmd_medusa()
{
    local cur prev words cword comp_args
    _comp_initialize -- "$@" || return

    case $prev in
        -*h)
            _comp_compgen_known_hosts -- "$cur"
            return
            ;;
        -*[HUPCO])
            _comp_compgen_filedir
            return
            ;;
        -*M)
            _comp_compgen_split -- "$("$1" -d | _comp_awk '/^ +\+/ {print $2}' |
                command sed -e 's/\.mod$//')"
            return
            ;;
    esac

    if [[ $cur == -* ]]; then
        _comp_compgen_help
    fi
} &&
    complete -F _comp_cmd_medusa medusa

# ex: filetype=sh