File tree Expand file tree Collapse file tree
src/main/java/org/mcphackers/mcp/main Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,14 +93,18 @@ public MainCLI(String[] args) {
9393 while (startedWithNoParams && !exit || !startedWithNoParams && executeTimes < 1 ) {
9494 while (args .length < 1 ) {
9595 System .out .print (new Ansi ().fgBrightCyan ().a ("> " ).fgRgb (255 ,255 ,255 ));
96- String str = "" ;
96+ String str = null ;
9797 try {
98- str = console .readLine (). trim () ;
98+ str = console .readLine ();
9999 } catch (NoSuchElementException ignored ) {
100+ }
101+ if (str == null ) {
100102 mode = TaskMode .EXIT ;
103+ } else {
104+ str = str .trim ();
105+ System .out .print (new Ansi ().fgDefault ());
106+ args = str .split (" " );
101107 }
102- System .out .print (new Ansi ().fgDefault ());
103- args = str .split (" " );
104108 }
105109 boolean taskMode = setMode (args [0 ]);
106110 Map <String , Object > parsedArgs = new HashMap <>();
You can’t perform that action at this time.
0 commit comments