.bash_completion.d/gradle
author Oleksandr Gavenko <gavenkoa@gmail.com>
Wed, 16 Oct 2013 18:42:07 +0300
changeset 643 9f5ece28cd08
child 644 5a6d6ad8e7f4
permissions -rw-r--r--
Add gradle completion.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
643
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     1
# -*- mode: sh; sh-shell-file: bash -*-
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
_gradle()
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
{
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
   local cmds cur colonprefixes
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
   COMPREPLY=()
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
   local _help_cmds='dependencies dependencyInsight help projects properties tasks'
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
   local _java_cmds='assemble build buildDependents buildNeeded classes compileJava processResources clean cleanTest jar testClasses compileTestJava processTestResources javadoc check test uploadArchives'
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
   cur=${COMP_WORDS[COMP_CWORD]}
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
   # colonprefixes=${cur%"${cur##*:}"}
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
   COMPREPLY=( $(compgen -W '$_help_cmds $_java_cmds'  -- $cur) )
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
   # local i=${#COMPREPLY[*]}
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
   # while [ $((--i)) -ge 0 ]; do
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
   #    COMPREPLY[$i]=${COMPREPLY[$i]#"$colonprefixes"}
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    15
   # done
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    16
   return 0
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
} &&
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    18
complete -F _gradle gradle