39 COMPREPLY=( --type ) |
39 COMPREPLY=( --type ) |
40 return ;; |
40 return ;; |
41 wrapper) |
41 wrapper) |
42 COMPREPLY=( --gradle-version ) |
42 COMPREPLY=( --gradle-version ) |
43 return ;; |
43 return ;; |
44 dependencies) |
44 dependencies|dependencyInsight) |
45 COMPREPLY=( --configuration ) |
45 COMPREPLY=( --configuration ) |
46 return ;; |
46 return ;; |
47 esac |
47 esac |
48 fi |
48 fi |
49 |
49 |
|
50 local _configs="archives - Configuration for archive artifacts. |
|
51 compile - Compile time dependencies. |
|
52 compileClasspath - Compile classpath, used when compiling source. |
|
53 compileOnly - Compile time only dependencies, not used at runtime. |
|
54 default - Dependencies required by this project at runtime. |
|
55 optional - |
|
56 provided - |
|
57 runtime - Runtime dependencies for source set 'main'. |
|
58 testCompile - Dependencies for source set 'test'. |
|
59 testCompileClasspath - Compile classpath for source set 'test'. |
|
60 testCompileOnly - Compile dependencies for source set 'test'. |
|
61 testRuntime - Runtime dependencies for source set 'test'." |
|
62 |
50 # Add or perform command specific completion. |
63 # Add or perform command specific completion. |
51 local cmd="$(_gradle_cmd)" |
64 local _cmd=$(_gradle_cmd) |
52 case "$cmd" in |
65 case "$_cmd" in |
53 help) |
66 help) |
54 case "$prev" in |
67 case "$prev" in |
55 --task) |
68 --task) |
56 COMPREPLY=( $(compgen -W '$_help_cmds $_java_cmds $_application_cmds $_other_cmd' -- $cur) ) |
69 COMPREPLY=( $(compgen -W '$_help_cmds $_java_cmds $_application_cmds $_other_cmd' -- $cur) ) |
57 return ;; |
70 return ;; |
73 _extra+=( --gradle-version ) |
86 _extra+=( --gradle-version ) |
74 ;; |
87 ;; |
75 dependencies) |
88 dependencies) |
76 case "$prev" in |
89 case "$prev" in |
77 --configuration) |
90 --configuration) |
78 local _configs="archives - Configuration for archive artifacts. |
|
79 compile - Compile time dependencies. |
|
80 compileClasspath - Compile classpath, used when compiling source. |
|
81 compileOnly - Compile time only dependencies, not used at runtime. |
|
82 default - Dependencies required by this project at runtime. |
|
83 optional - |
|
84 provided - |
|
85 runtime - Runtime dependencies for source set 'main'. |
|
86 testCompile - Dependencies for source set 'test'. |
|
87 testCompileClasspath - Compile classpath for source set 'test'. |
|
88 testCompileOnly - Compile dependencies for source set 'test'. |
|
89 testRuntime - Runtime dependencies for source set 'test'." |
|
90 local IFS=$'\n' |
91 local IFS=$'\n' |
91 COMPREPLY=( $(compgen -W '${_configs}' -- "$cur") ) |
92 COMPREPLY=( $(compgen -W '${_configs}' -- "$cur") ) |
92 if [[ ${#COMPREPLY[@]} -le 1 ]]; then |
93 if [[ ${#COMPREPLY[@]} -le 1 ]]; then |
93 COMPREPLY=( ${COMPREPLY[0]%% *-*} ) |
94 COMPREPLY=( ${COMPREPLY[0]%% *-*} ) |
94 fi |
95 fi |
95 return ;; |
96 return ;; |
96 esac |
97 esac |
97 _extra+=( --configuration ) |
98 _extra+=( --configuration ) |
|
99 ;; |
|
100 dependencyInsight) |
|
101 case "$prev" in |
|
102 --configuration) |
|
103 local IFS=$'\n' |
|
104 COMPREPLY=( $(compgen -W '${_configs}' -- "$cur") ) |
|
105 if [[ ${#COMPREPLY[@]} -le 1 ]]; then |
|
106 COMPREPLY=( ${COMPREPLY[0]%% *-*} ) |
|
107 fi |
|
108 return ;; |
|
109 esac |
|
110 _extra+=( --configuration --dependency ) |
98 ;; |
111 ;; |
99 esac |
112 esac |
100 |
113 |
101 # Perform generic completion. |
114 # Perform generic completion. |
102 case "$prev" in |
115 case "$prev" in |