Christopher Fujino 7e151b4641
[flutter_tools] throw tool exit on invocation of flutter format (#121646)
[flutter_tools] throw tool exit on invocation of flutter format
2023-03-16 21:40:26 +00:00

40 lines
966 B
Dart

// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:args/args.dart';
import '../base/common.dart';
import '../runner/flutter_command.dart';
class FormatCommand extends FlutterCommand {
FormatCommand();
@override
ArgParser argParser = ArgParser.allowAnything();
@override
final String name = 'format';
@override
List<String> get aliases => const <String>['dartfmt'];
@override
String get description => deprecationWarning;
@override
final bool hidden = true;
@override
String get deprecationWarning {
return 'The "format" command is deprecated. Please use the "dart format" '
'sub-command instead, which has the same command-line usage as '
'"flutter format".\n';
}
@override
Future<FlutterCommandResult> runCommand() async {
throwToolExit(deprecationWarning);
}
}