diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index e3fe238ca..b692b11b8 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -268,7 +268,7 @@ public class Base { } - protected static enum ACTION { GUI, VERIFY, UPLOAD }; + protected static enum ACTION { GUI, VERIFY, UPLOAD, NOOP }; public Base(String[] args) throws Exception { platform.init(this); @@ -331,6 +331,7 @@ public class Base { final Map actions = new HashMap(); actions.put("--verify", ACTION.VERIFY); actions.put("--upload", ACTION.UPLOAD); + actions.put("--noop", ACTION.NOOP); // Check if any files were passed in on the command line for (int i = 0; i < args.length; i++) { @@ -405,6 +406,9 @@ public class Base { if ((action == ACTION.UPLOAD || action == ACTION.VERIFY) && filenames.size() != 1) showError(null, _("Must specify exactly one sketch file"), 3); + if (action == ACTION.NOOP && filenames.size() != 0) + showError(null, _("Cannot specify any sketch files"), 3); + if ((action != ACTION.UPLOAD && action != ACTION.VERIFY) && (doVerboseBuild || doVerboseUpload)) showError(null, _("--verbose, --verbose-upload and --verbose-build can only be used together with --verify or --upload"), 3); @@ -485,6 +489,10 @@ public class Base { new UpdateCheck(this); } break; + case NOOP: + // Do nothing (intended for only changing preferences) + System.exit(0); + break; } } diff --git a/build/shared/manpage.adoc b/build/shared/manpage.adoc index 12d2bdba9..db52b2f50 100644 --- a/build/shared/manpage.adoc +++ b/build/shared/manpage.adoc @@ -145,6 +145,10 @@ OPTIONS *--verify*:: Build the sketch. +*--noop*:: + Immediately quit after processing the commandline. This can be + used to just set preferences with *--pref*. + PREFERENCES ----------- Arduino keeps a list of preferences, as simple name and value pairs. @@ -232,6 +236,10 @@ re-use any previous build results in that directory. arduino --pref build.path=/path/to/sketch/build --verify /path/to/sketch/sketch.ino +Change the selected board and build path and do nothing else. + + arduino --pref build.path=/path/to/sketch/build --board arduino:avr:uno --noop + HISTORY ------- 1.5.2:: @@ -259,7 +267,7 @@ HISTORY Windows, the splash screen is still shown. 1.5.7:: - Introduced *--no-save-prefs*. + Introduced *--no-save-prefs* and *--noop*. {empty}:: *--board* and *--port* options are now saved to the preferences