Commit 37e32d5a authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Switch `flutter --version --json` to be `flutter --version --machine` (#10627)

parent dbaf12b8
...@@ -60,7 +60,7 @@ class FlutterCommandRunner extends CommandRunner<Null> { ...@@ -60,7 +60,7 @@ class FlutterCommandRunner extends CommandRunner<Null> {
argParser.addFlag('version', argParser.addFlag('version',
negatable: false, negatable: false,
help: 'Reports the version of this tool.'); help: 'Reports the version of this tool.');
argParser.addFlag('json', argParser.addFlag('machine',
negatable: false, negatable: false,
hide: true); hide: true);
argParser.addFlag('color', argParser.addFlag('color',
...@@ -260,7 +260,7 @@ class FlutterCommandRunner extends CommandRunner<Null> { ...@@ -260,7 +260,7 @@ class FlutterCommandRunner extends CommandRunner<Null> {
if (globalResults['version']) { if (globalResults['version']) {
flutterUsage.sendCommand('version'); flutterUsage.sendCommand('version');
String status; String status;
if (globalResults['json']) { if (globalResults['machine']) {
status = const JsonEncoder.withIndent(' ').convert(FlutterVersion.instance.toJson()); status = const JsonEncoder.withIndent(' ').convert(FlutterVersion.instance.toJson());
} else { } else {
status = FlutterVersion.instance.toString(); status = FlutterVersion.instance.toString();
...@@ -269,8 +269,8 @@ class FlutterCommandRunner extends CommandRunner<Null> { ...@@ -269,8 +269,8 @@ class FlutterCommandRunner extends CommandRunner<Null> {
return; return;
} }
if (globalResults['json']) { if (globalResults['machine']) {
printError('The --json flag is only valid with the --version flag.'); printError('The --machine flag is only valid with the --version flag.');
throw new ProcessExit(2); throw new ProcessExit(2);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment