mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
Command line --get-pref may be used without name of the target pref.
If pref name is missing, all prefs are printed on stdout. Should fix/mitigate #2982
This commit is contained in:
@ -570,6 +570,12 @@ public class BaseNoGui {
|
||||
System.exit(0);
|
||||
}
|
||||
else if (parser.isGetPrefMode()) {
|
||||
dumpPrefs(parser);
|
||||
}
|
||||
}
|
||||
|
||||
protected static void dumpPrefs(CommandlineParser parser) {
|
||||
if (parser.getGetPref() != null) {
|
||||
String value = PreferencesData.get(parser.getGetPref(), null);
|
||||
if (value != null) {
|
||||
System.out.println(value);
|
||||
@ -577,6 +583,13 @@ public class BaseNoGui {
|
||||
} else {
|
||||
System.exit(4);
|
||||
}
|
||||
} else {
|
||||
System.out.println("#PREFDUMP#");
|
||||
PreferencesMap prefs = PreferencesData.getMap();
|
||||
for (Map.Entry<String, String> entry : prefs.entrySet()) {
|
||||
System.out.println(entry.getKey() + "=" + entry.getValue());
|
||||
}
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user