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> {
argParser.addFlag('version',
negatable: false,
help: 'Reports the version of this tool.');
argParser.addFlag('json',
argParser.addFlag('machine',
negatable: false,
hide: true);
argParser.addFlag('color',
......@@ -260,7 +260,7 @@ class FlutterCommandRunner extends CommandRunner<Null> {
if (globalResults['version']) {
flutterUsage.sendCommand('version');
String status;
if (globalResults['json']) {
if (globalResults['machine']) {
status = const JsonEncoder.withIndent(' ').convert(FlutterVersion.instance.toJson());
} else {
status = FlutterVersion.instance.toString();
......@@ -269,8 +269,8 @@ class FlutterCommandRunner extends CommandRunner<Null> {
return;
}
if (globalResults['json']) {
printError('The --json flag is only valid with the --version flag.');
if (globalResults['machine']) {
printError('The --machine flag is only valid with the --version flag.');
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