mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-15 12:29:26 +01:00
parent
651dcd5271
commit
e1caaf1c45
@ -267,6 +267,8 @@ public class Base {
|
|||||||
splash.splashText(tr("Initializing packages..."));
|
splash.splashText(tr("Initializing packages..."));
|
||||||
BaseNoGui.initPackages();
|
BaseNoGui.initPackages();
|
||||||
|
|
||||||
|
parser.getUploadPort().ifPresent(BaseNoGui::selectSerialPort);
|
||||||
|
|
||||||
splash.splashText(tr("Preparing boards..."));
|
splash.splashText(tr("Preparing boards..."));
|
||||||
|
|
||||||
if (!isCommandLine()) {
|
if (!isCommandLine()) {
|
||||||
|
@ -41,6 +41,7 @@ public class CommandlineParser {
|
|||||||
private String getPref;
|
private String getPref;
|
||||||
private String boardToInstall;
|
private String boardToInstall;
|
||||||
private String libraryToInstall;
|
private String libraryToInstall;
|
||||||
|
private Optional<String> uploadPort = Optional.empty();
|
||||||
private final List<String> filenames = new LinkedList<>();
|
private final List<String> filenames = new LinkedList<>();
|
||||||
|
|
||||||
public CommandlineParser(String[] args) {
|
public CommandlineParser(String[] args) {
|
||||||
@ -141,7 +142,7 @@ public class CommandlineParser {
|
|||||||
i++;
|
i++;
|
||||||
if (i >= args.length)
|
if (i >= args.length)
|
||||||
BaseNoGui.showError(null, tr("Argument required for --port"), 3);
|
BaseNoGui.showError(null, tr("Argument required for --port"), 3);
|
||||||
BaseNoGui.selectSerialPort(args[i]);
|
uploadPort = Optional.of(args[i]);
|
||||||
if (action == ACTION.GUI)
|
if (action == ACTION.GUI)
|
||||||
action = ACTION.NOOP;
|
action = ACTION.NOOP;
|
||||||
continue;
|
continue;
|
||||||
@ -356,4 +357,8 @@ public class CommandlineParser {
|
|||||||
public boolean isPreserveTempFiles() {
|
public boolean isPreserveTempFiles() {
|
||||||
return preserveTempFiles;
|
return preserveTempFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Optional<String> getUploadPort() {
|
||||||
|
return uploadPort;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user