Completion for "dependencies --configuration".
# -*- mode: sh; sh-shell-file: bash -*-
_gradle()
{
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 \
-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 \
-q --quiet -r --properties -s --stacktrace -t --tasks -u --no-search-upward -v --version -x --exclude-task \
--continue --daemon --foreground --no-color --no-daemon --offline --parallel --parallel-threads --project-cache-dir --recompile-scripts --refresh --refresh-dependencies \
--rerun-tasks --stop"
local _help_cmds='components dependencies dependencyInsight buildEnvironment help model projects properties tasks wrapper'
local _java_cmds='assemble build buildDependents buildNeeded classes compileJava processResources clean cleanTest jar testClasses compileTestJava processTestResources javadoc check test uploadArchives'
local _application_cmds='run startScripts installApp distZip distTar'
local _other_cmd='install interactive'
local cur prev
cur=${COMP_WORDS[COMP_CWORD]}
[[ $COMP_CWORD != 0 ]] && prev=${COMP_WORDS[COMP_CWORD-1]}
case "$prev" in
-I|--init-script|-b|--build-file|-c|--settings-file|-e|--embedded)
COMPREPLY=( $(compgen -f -- "$cur") )
return ;;
-g|--gradle-user-home|-p|--project-dir|--project-cache-dir)
COMPREPLY=( $(compgen -d -- "$cur") )
return ;;
help)
COMPREPLY=( $(compgen -W "--task" -- "$cur") )
return ;;
wrapper)
COMPREPLY=( $(compgen -W "--gradle-version" -- "$cur") )
return ;;
dependencies)
COMPREPLY=( $(compgen -W "--configuration" -- "$cur") )
return ;;
--configuration)
local _configs="archives - Configuration for archive artifacts.
compile - Compile time dependencies.
compileClasspath - Compile classpath, used when compiling source.
compileOnly - Compile time only dependencies, not used at runtime.
default - Dependencies required by this project at runtime.
optional -
provided -
runtime - Runtime dependencies for source set 'main'.
testCompile - Dependencies for source set 'test'.
testCompileClasspath - Compile classpath for source set 'test'.
testCompileOnly - Compile dependencies for source set 'test'.
testRuntime - Runtime dependencies for source set 'test'."
local IFS=$'\n'
COMPREPLY=( $(compgen -W '${_configs}' -- "$cur") )
if [[ ${#COMPREPLY[@]} -le 1 ]]; then
COMPREPLY=( ${COMPREPLY[0]%% *-*} )
fi
return ;;
--task)
COMPREPLY=( $(compgen -W '$_help_cmds $_java_cmds $_application_cmds $_other_cmd' -- $cur) )
return ;;
esac
# colonprefixes=${cur%"${cur##*:}"}
COMPREPLY=( $(compgen -W '$_opts $_help_cmds $_java_cmds $_application_cmds $_other_cmd' -- $cur) )
# local i=${#COMPREPLY[*]}
# while [ $((--i)) -ge 0 ]; do
# COMPREPLY[$i]=${COMPREPLY[$i]#"$colonprefixes"}
# done
return 0
} &&
complete -F _gradle gradle ./gradlew