File tree Expand file tree Collapse file tree
main/java/com/redhat/exhort/cli
test/java/com/redhat/exhort/cli Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,7 +81,10 @@ private static CliArgs parseArgs(String[] args) {
8181
8282 Path path = validateFile (args [1 ]);
8383
84- OutputFormat outputFormat = parseOutputFormat (command , args [2 ]);
84+ OutputFormat outputFormat = OutputFormat .JSON ;
85+ if (args .length == 3 ) {
86+ outputFormat = parseOutputFormat (command , args [2 ]);
87+ }
8588
8689 return new CliArgs (command , path , outputFormat );
8790 }
@@ -99,10 +102,6 @@ private static Command parseCommand(String commandStr) {
99102 }
100103
101104 private static OutputFormat parseOutputFormat (Command command , String formatArg ) {
102- if (formatArg == null ) {
103- return OutputFormat .JSON ;
104- }
105-
106105 switch (formatArg ) {
107106 case "--summary" :
108107 return OutputFormat .SUMMARY ;
@@ -125,9 +124,6 @@ private static Path validateFile(String filePath) {
125124 if (!Files .isRegularFile (path )) {
126125 throw new IllegalArgumentException ("File is not a regular file: " + filePath );
127126 }
128- if (!Files .isReadable (path )) {
129- throw new IllegalArgumentException ("File is not readable: " + filePath );
130- }
131127 return path ;
132128 }
133129
Original file line number Diff line number Diff line change @@ -20,10 +20,6 @@ public static void exitWithError() {
2020 System .exit (1 );
2121 }
2222
23- public static void exitWithSuccess () {
24- System .exit (0 );
25- }
26-
2723 public static void printLine (String message ) {
2824 System .out .println (message );
2925 }
You can’t perform that action at this time.
0 commit comments