@@ -23,6 +23,7 @@ public static void main(String... args) {
23
23
Options options = new Options ();
24
24
options .addOption (Option .builder ("h" ).longOpt ("help" ).desc ("print this message" ).build ());
25
25
options .addOption (Option .builder ().longOpt ("version" ).desc ("print the version information and exit" ).build ());
26
+ options .addOption (Option .builder ().longOpt ("state" ).desc ("Only output diff state: no_changes, incompatible, compatible" ).build ());
26
27
options .addOption (Option .builder ().longOpt ("trace" ).desc ("be extra verbose" ).build ());
27
28
options .addOption (Option .builder ().longOpt ("debug" ).desc ("Print debugging information" ).build ());
28
29
options .addOption (Option .builder ().longOpt ("info" ).desc ("Print additional information" ).build ());
@@ -81,6 +82,9 @@ public static void main(String... args) {
81
82
logLevel ));
82
83
}
83
84
}
85
+ if (line .hasOption ("state" )) {
86
+ logLevel = "OFF" ;
87
+ }
84
88
LogManager .getRootLogger ().setLevel (Level .toLevel (logLevel ));
85
89
86
90
if (line .getArgList ().size () < 2 ) {
@@ -126,7 +130,12 @@ public static void main(String... args) {
126
130
System .exit (2 );
127
131
}
128
132
}
129
- System .exit (result .isDiff () ? 1 : 0 );
133
+ if (line .hasOption ("state" )) {
134
+ System .out .println (result .isDiff () ? result .isDiffBackwardCompatible () ? "compatible" : "incompatible" : "no_changes" );
135
+ System .exit (0 );
136
+ } else {
137
+ System .exit (result .isDiff () ? 1 : 0 );
138
+ }
130
139
} catch (ParseException e ) {
131
140
// oops, something went wrong
132
141
System .err .println ("Parsing failed. Reason: " + e .getMessage ());
0 commit comments