File tree Expand file tree Collapse file tree
src/main/java/the/bytecode/club/bytecodeviewer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131import the .bytecode .club .bytecodeviewer .bootloader .InstallFatJar ;
3232import the .bytecode .club .bytecodeviewer .bootloader .UpdateCheck ;
3333import the .bytecode .club .bytecodeviewer .cli .BCVCommandLine ;
34+ import the .bytecode .club .bytecodeviewer .cli .CLICommand ;
3435import the .bytecode .club .bytecodeviewer .gui .MainViewerGUI ;
3536import the .bytecode .club .bytecodeviewer .gui .components .ExtendedJOptionPane ;
3637import the .bytecode .club .bytecodeviewer .gui .components .MultipleChoiceDialog ;
@@ -286,9 +287,28 @@ public static void boot()
286287 viewer .requestFocus ();
287288
288289 //open files from launch args
289- if (launchArgs .length >= 1 )
290- for (String s : launchArgs )
291- openFiles (new File []{new File (s )}, true );
290+ openFilesFromLaunchArguments ();
291+ }
292+
293+ private static void openFilesFromLaunchArguments ()
294+ {
295+ if (launchArgs .length < 1 )
296+ return ;
297+
298+ //parse input for commands
299+ for (int i = 0 ; i < launchArgs .length ; i ++)
300+ {
301+ String fileInput = launchArgs [i ];
302+ CLICommand command = CLI .getCommand (fileInput );
303+
304+ if (command != null )
305+ {
306+ if (command .hasArgs )
307+ i ++;
308+ }
309+ else
310+ openFiles (new File []{new File (fileInput )}, true );
311+ }
292312 }
293313
294314 /**
You can’t perform that action at this time.
0 commit comments