PageRenderTime 24ms CodeModel.GetById 21ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/bash_completion.d/monodevelop

http://github.com/brinkman83/bashrc
#! | 86 lines | 76 code | 10 blank | 0 comment | 0 complexity | 95a5a3d28c05a85d33da92b2bab7febe MD5 | raw file
 1# Monodevelop completion
 2
 3have monodevelop &&
 4_monodevelop()
 5{
 6    local cur
 7    cur=`_get_cword`
 8
 9    if [[ "$cur" == -* ]]; then
10        COMPREPLY=( $( compgen -W '-? -help -help2 -ipc-tcp -newwindow -nologo \
11            -usage -V -version' -- "$cur" ) )
12    else
13        _filedir
14    fi
15    return 0
16} &&
17complete -F _monodevelop monodevelop
18
19have mdtool &&
20_mdtool()
21{
22    local cur prev command i
23
24    COMPREPLY=()
25
26    cur=`_get_cword`
27    prev=${COMP_WORDS[COMP_CWORD-1]}
28
29    for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
30        if [[ ${COMP_WORDS[i]} == @(build|generate-makefiles|setup) ]]; then
31            command=${COMP_WORDS[i]}
32        fi
33    done
34
35    if [[ -n "$command" ]]; then
36        case $command in
37            "build")
38                COMPREPLY=( $( compgen -W '--f --buildfile --p --project' \
39                    -S":" -- "$cur" ) )
40                # TODO: This does not work :(
41                #if [[ "$prev" == *: ]]; then
42                #   case "$prev" in
43                #       @(--p:|--project:))
44                #           COMPREPLY=( $( compgen -f -G "*.mdp" -- "$cur" ) )
45                #           ;;
46                #       @(--f:|--buildfile:))
47                #           COMPREPLY=( $( compgen -f -G "*.mdp" -G "*.mds" -- "$cur" ) )
48                #           ;;
49                #   esac
50                #fi
51                return 0
52                ;;
53            "generate-makefiles")
54                COMPREPLY=( $( compgen $filenames -G"*.mds" -- "$cur" ) )
55                if [[ "$prev" == *mds ]]; then
56                    COMPREPLY=( $( compgen -W '--simple-makefiles --s --d:' \
57                        -- "$cur" ) )
58                fi
59                return 0
60                ;;
61            "setup")
62                # TODO: at least return filenames after these options.
63                COMPREPLY=( $( compgen -W 'install i uninstall u check-install \
64                    ci update up list l list-av la list-update lu rep-add ra \
65                    rep-remove rr rep-update ru rep-list rl reg-update \
66                    reg-build rgu info rep-build rb pack p help h dump-file' \
67                    -- "$cur" ) )
68                return 0
69                ;;
70        esac
71    fi
72
73    COMPREPLY=( $( compgen -W 'gsetup build dbgen project-export \
74        generate-makefiles gettext-update setup -q' -- "$cur" ) )
75
76    return 0
77} &&
78complete -F _mdtool $filenames mdtool
79
80# Local variables:
81# mode: shell-script
82# sh-basic-offset: 4
83# sh-indent-comment: t
84# indent-tabs-mode: nil
85# End:
86# ex: ts=4 sw=4 et filetype=sh