@@ -98,18 +98,24 @@ public abstract class AbstractValidateContentCommand
98
98
@ NonNull
99
99
private static final Option CONSTRAINTS_OPTION = ObjectUtils .notNull (
100
100
Option .builder ("c" )
101
- .hasArg ()
101
+ .hasArgs ()
102
102
.argName ("URI" )
103
103
.desc ("additional constraint definitions" )
104
104
.build ());
105
105
@ NonNull
106
- private static final Option OUTPUT_FILE_OPTION = ObjectUtils .notNull (
106
+ private static final Option SARIF_OUTPUT_FILE_OPTION = ObjectUtils .notNull (
107
107
Option .builder ("o" )
108
108
.hasArg ()
109
109
.argName ("FILE" )
110
110
.desc ("write SARIF results to the provided FILE" )
111
111
.numberOfArgs (1 )
112
112
.build ());
113
+ @ NonNull
114
+ private static final Option SARIF_INCLUDE_PASS_OPTION = ObjectUtils .notNull (
115
+ Option .builder ()
116
+ .longOpt ("sarif-include-pass" )
117
+ .desc ("include pass results in SARIF" )
118
+ .build ());
113
119
114
120
@ Override
115
121
public String getName () {
@@ -122,7 +128,8 @@ public Collection<? extends Option> gatherOptions() {
122
128
return List .of (
123
129
AS_OPTION ,
124
130
CONSTRAINTS_OPTION ,
125
- OUTPUT_FILE_OPTION );
131
+ SARIF_OUTPUT_FILE_OPTION ,
132
+ SARIF_INCLUDE_PASS_OPTION );
126
133
}
127
134
128
135
@ Override
@@ -250,7 +257,7 @@ public ExitStatus execute() {
250
257
}
251
258
252
259
IMutableConfiguration <ValidationFeature <?>> configuration = new DefaultConfiguration <>();
253
- if (cmdLine .hasOption (OUTPUT_FILE_OPTION )) {
260
+ if (cmdLine .hasOption (SARIF_OUTPUT_FILE_OPTION ) && cmdLine . hasOption ( SARIF_INCLUDE_PASS_OPTION )) {
254
261
configuration .enableFeature (ValidationFeature .VALIDATE_GENERATE_PASS_FINDINGS );
255
262
}
256
263
@@ -267,8 +274,8 @@ public ExitStatus execute() {
267
274
return ExitCode .PROCESSING_ERROR .exit ().withThrowable (ex );
268
275
}
269
276
270
- if (cmdLine .hasOption (OUTPUT_FILE_OPTION ) && LOGGER .isInfoEnabled ()) {
271
- Path sarifFile = Paths .get (cmdLine .getOptionValue (OUTPUT_FILE_OPTION ));
277
+ if (cmdLine .hasOption (SARIF_OUTPUT_FILE_OPTION ) && LOGGER .isInfoEnabled ()) {
278
+ Path sarifFile = Paths .get (cmdLine .getOptionValue (SARIF_OUTPUT_FILE_OPTION ));
272
279
273
280
IVersionInfo version
274
281
= getCallingContext ().getCLIProcessor ().getVersionInfos ().get (CLIProcessor .COMMAND_VERSION );
0 commit comments