.bash_completion.d/gradle
author Oleksandr Gavenko <gavenkoa@gmail.com>
Mon, 18 Apr 2016 12:19:35 +0300
changeset 794 62c7121c2f88
parent 734 da0dc50393b6
child 827 4bd348e3422d
permissions -rw-r--r--
"graft" extension built-in, "transplant" is depricated.
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
{
734
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
     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 \
645
51f6d81be3da Update options according to "gradle --help" with v1.4.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 644
diff changeset
     6
     -b --build-file -c --settings-file -d --debug -e --embedded -g --gradle-user-home --gui -i --info -m --dry-run --no-opt -p --project-dir \
51f6d81be3da Update options according to "gradle --help" with v1.4.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 644
diff changeset
     7
     -q --quiet -r --properties -s --stacktrace -t --tasks -u --no-search-upward -v --version -x --exclude-task \
51f6d81be3da Update options according to "gradle --help" with v1.4.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 644
diff changeset
     8
     --continue --daemon --foreground --no-color --no-daemon --offline --parallel --parallel-threads --project-cache-dir --recompile-scripts --refresh --refresh-dependencies \
51f6d81be3da Update options according to "gradle --help" with v1.4.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 644
diff changeset
     9
     --rerun-tasks --stop"
734
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    10
  local _help_cmds='dependencies dependencyInsight help projects properties tasks'
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    11
  local _java_cmds='assemble build buildDependents buildNeeded classes compileJava processResources clean cleanTest jar testClasses compileTestJava processTestResources javadoc check test uploadArchives'
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    12
  local _application_cmds='run startScripts installApp distZip distTar'
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    13
  local cur prev
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    14
  cur=${COMP_WORDS[COMP_CWORD]}
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    15
  [[ $COMP_CWORD != 0 ]] && prev=${COMP_WORDS[COMP_CWORD-1]}
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    16
  case "$prev" in
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    17
    -I|--init-script|-b|--build-file|-c|--settings-file|-e|--embedded)
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    18
      COMPREPLY=( $(compgen -f -- "$cur") )
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    19
      return ;;
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    20
    -g|--gradle-user-home|-p|--project-dir|--project-cache-dir)
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    21
      COMPREPLY=( $(compgen -d -- "$cur") )
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    22
      return ;;
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    23
  esac
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    24
  # colonprefixes=${cur%"${cur##*:}"}
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    25
  COMPREPLY=( $(compgen -W '$_opts $_help_cmds $_java_cmds $_application_cmds'  -- $cur) )
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    26
  # local i=${#COMPREPLY[*]}
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    27
  # while [ $((--i)) -ge 0 ]; do
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    28
  #    COMPREPLY[$i]=${COMPREPLY[$i]#"$colonprefixes"}
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    29
  # done
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    30
  return 0
643
9f5ece28cd08 Add gradle completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    31
} &&
734
da0dc50393b6 Reindent sources.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 645
diff changeset
    32
    complete -F _gradle gradle