.bash_completion.d/gradle
changeset 644 5a6d6ad8e7f4
parent 643 9f5ece28cd08
child 645 51f6d81be3da
equal deleted inserted replaced
643:9f5ece28cd08 644:5a6d6ad8e7f4
     1 # -*- mode: sh; sh-shell-file: bash -*-
     1 # -*- mode: sh; sh-shell-file: bash -*-
     2 
     2 
     3 _gradle()
     3 _gradle()
     4 {
     4 {
     5    local cmds cur colonprefixes
     5    local _opts="-? -h --help -A --dep-tasks -C --cache -D --system-prop -I --init-script -P --project-prop -S --full-stacktrace -a --no-rebuild --all \
     6    COMPREPLY=()
     6      -b --build-file -c --settings-file -d --debug -e --embedded -g --gradle-user-home --gui -i --info -m --dry-run -n --dependencies --no-opt -p --project-dir \
       
     7      -q --quiet -r --properties -s --stacktrace -t --tasks -u --no-search-upward -v --version -x --exclude-task"
     7    local _help_cmds='dependencies dependencyInsight help projects properties tasks'
     8    local _help_cmds='dependencies dependencyInsight help projects properties tasks'
     8    local _java_cmds='assemble build buildDependents buildNeeded classes compileJava processResources clean cleanTest jar testClasses compileTestJava processTestResources javadoc check test uploadArchives'
     9    local _java_cmds='assemble build buildDependents buildNeeded classes compileJava processResources clean cleanTest jar testClasses compileTestJava processTestResources javadoc check test uploadArchives'
       
    10    local _application_cmds='run startScripts installApp distZip distTar'
       
    11    local cur prev
     9    cur=${COMP_WORDS[COMP_CWORD]}
    12    cur=${COMP_WORDS[COMP_CWORD]}
       
    13    [[ $COMP_CWORD != 0 ]] && prev=${COMP_WORDS[COMP_CWORD-1]}
       
    14    case "$prev" in
       
    15      -I|--init-script|-b|--build-file|-c|--settings-file|-e|--embedded)
       
    16        COMPREPLY=( $(compgen -f -- "$cur") )
       
    17        return ;;
       
    18      -g|--gradle-user-home|-p|--project-dir)
       
    19        COMPREPLY=( $(compgen -d -- "$cur") )
       
    20        return ;;
       
    21    esac
    10    # colonprefixes=${cur%"${cur##*:}"}
    22    # colonprefixes=${cur%"${cur##*:}"}
    11    COMPREPLY=( $(compgen -W '$_help_cmds $_java_cmds'  -- $cur) )
    23    COMPREPLY=( $(compgen -W '$_opts $_help_cmds $_java_cmds $_application_cmds'  -- $cur) )
    12    # local i=${#COMPREPLY[*]}
    24    # local i=${#COMPREPLY[*]}
    13    # while [ $((--i)) -ge 0 ]; do
    25    # while [ $((--i)) -ge 0 ]; do
    14    #    COMPREPLY[$i]=${COMPREPLY[$i]#"$colonprefixes"}
    26    #    COMPREPLY[$i]=${COMPREPLY[$i]#"$colonprefixes"}
    15    # done
    27    # done
    16    return 0
    28    return 0