@@ -415,7 +415,11 @@ class WriterFactory {
415415 }
416416
417417 static AbstractWriter* createJson () {
418- return new JsonWriter (std::cout);
418+ return new JsonWriter (std::cout, FF_JSON);
419+ }
420+
421+ static AbstractWriter* createSarif () {
422+ return new JsonWriter (std::cout, FF_SARIF);
419423 }
420424
421425 static AbstractWriter* createKeyEventPrinter () {
@@ -435,6 +439,7 @@ class WriterFactory {
435439 tbl_[" grep" ] = createGrep;
436440 tbl_[" grouped" ] = createGrouped;
437441 tbl_[" json" ] = createJson;
442+ tbl_[" sarif" ] = createSarif;
438443 tbl_[" stat" ] = createStat;
439444 }
440445
@@ -593,7 +598,7 @@ int main(int argc, char *argv[])
593598 (" quiet,q" , " do not report any parsing errors" )
594599
595600 (" mode" , po::value<string>(&mode)
596- ->default_value (" grep" ), " grep, json, evtstat, files, filestat, grouped, stat, or dig_key_events" )
601+ ->default_value (" grep" ), " grep, json, evtstat, files, filestat, grouped, sarif, stat, or dig_key_events" )
597602
598603 (" help" , " print the usage of csgrep" )
599604 (" version" , " print the version of csgrep" );
0 commit comments