@@ -38,7 +38,7 @@ public class IterationScript implements Callable<Integer> {
38
38
39
39
@ Option (names = { "-s" , "--state" }, description = "state" )
40
40
private IterationFilter .IterationFilterState state ;
41
-
41
+
42
42
@ Option (names = { "-q" , "--query" }, description = "query" )
43
43
private String search ;
44
44
@@ -47,16 +47,19 @@ public class IterationScript implements Callable<Integer> {
47
47
48
48
@ Option (names = { "-n" , "--includeAncestors" }, description = "include ancestors" )
49
49
private Boolean includeAncestors ;
50
-
50
+
51
51
@ Option (names = { "-a" , "--after" }, description = "updated after" )
52
52
private Date updatedAfter ;
53
-
53
+
54
54
@ Option (names = { "-b" , "--before" }, description = "updated before" )
55
55
private Date updatedBefore ;
56
56
57
57
@ Option (names = { "-c" , "--config" }, description = "configuration file location" )
58
58
String configFile ;
59
59
60
+ @ Option (names = { "-v" , "--verbose" }, description = "log http trafic" )
61
+ Boolean logHttp ;
62
+
60
63
@ Override
61
64
public Integer call () throws Exception {
62
65
Path file ;
@@ -73,44 +76,49 @@ public Integer call() throws Exception {
73
76
if (project != null && group != null ) {
74
77
System .out .println ("'--project' and '--group' can't be set at the same time" );
75
78
return 1 ;
76
- } else if (project == null && group == null ) {
79
+ } else if (project == null && group == null ) {
77
80
System .out .println ("One of '--project' and '--group' must be set" );
78
81
return 1 ;
79
82
}
80
83
try (GitLabApi gitLabApi = new GitLabApi (gitLabUrl , gitLabAuthValue )) {
84
+ if (logHttp != null && logHttp ) {
85
+ gitLabApi .enableRequestResponseLogging (java .util .logging .Level .INFO , 2000000000 );
86
+ }
81
87
List <?> result ;
82
88
IterationFilter filter = null ;
83
- if (state != null ) {
89
+ if (state != null ) {
84
90
filter = existingOrNew (filter );
85
91
filter .setState (state );
86
92
}
87
- if (search != null ) {
93
+ if (search != null ) {
88
94
filter = existingOrNew (filter );
89
95
filter .setSearch (search );
90
96
}
91
- if (in != null ) {
97
+ if (in != null ) {
92
98
filter = existingOrNew (filter );
93
99
filter .setIn (in );
94
100
}
95
- if (includeAncestors != null ) {
101
+ if (includeAncestors != null ) {
96
102
filter = existingOrNew (filter );
97
103
filter .setIncludeAncestors (includeAncestors );
98
104
}
99
- if (updatedAfter != null ) {
105
+ if (updatedAfter != null ) {
100
106
filter = existingOrNew (filter );
101
107
filter .setUpdatedAfter (updatedAfter );
102
108
}
103
- if (updatedBefore != null ) {
109
+ if (updatedBefore != null ) {
104
110
filter = existingOrNew (filter );
105
111
filter .setUpdatedBefore (updatedBefore );
106
112
}
107
113
108
114
if (project != null ) {
109
115
System .out .println ("Project iteration..." );
110
- result = gitLabApi .getProjectApi ().listProjectIterations (idOrPath (project ), filter );
116
+ result = gitLabApi .getProjectApi ()
117
+ .listProjectIterations (idOrPath (project ), filter );
111
118
} else if (group != null ) {
112
119
System .out .println ("Group iteration..." );
113
- result = gitLabApi .getGroupApi ().listGroupIterations (idOrPath (group ), filter );
120
+ result = gitLabApi .getGroupApi ()
121
+ .listGroupIterations (idOrPath (group ), filter );
114
122
} else {
115
123
throw new IllegalArgumentException ("Unexpected state (input parameters might be wrong)" );
116
124
}
0 commit comments