File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
arduino-core/src/processing/app/helpers Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -269,6 +269,8 @@ public Base(String[] args) throws Exception {
269269 splash .splashText (tr ("Initializing packages..." ));
270270 BaseNoGui .initPackages ();
271271
272+ parser .getUploadPort ().ifPresent (BaseNoGui ::selectSerialPort );
273+
272274 splash .splashText (tr ("Preparing boards..." ));
273275
274276 if (!isCommandLine ()) {
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ private enum ACTION {
4141 private String getPref ;
4242 private String boardToInstall ;
4343 private String libraryToInstall ;
44+ private Optional <String > uploadPort = Optional .empty ();
4445 private final List <String > filenames = new LinkedList <>();
4546
4647 public CommandlineParser (String [] args ) {
@@ -141,7 +142,7 @@ public void parseArgumentsPhase1() {
141142 i ++;
142143 if (i >= args .length )
143144 BaseNoGui .showError (null , tr ("Argument required for --port" ), 3 );
144- BaseNoGui . selectSerialPort (args [i ]);
145+ uploadPort = Optional . of (args [i ]);
145146 if (action == ACTION .GUI )
146147 action = ACTION .NOOP ;
147148 continue ;
@@ -356,4 +357,8 @@ public String getLibraryToInstall() {
356357 public boolean isPreserveTempFiles () {
357358 return preserveTempFiles ;
358359 }
360+
361+ public Optional <String > getUploadPort () {
362+ return uploadPort ;
363+ }
359364}
You can’t perform that action at this time.
0 commit comments