Add Flags class. (#12268)
This class lives in the Context and allows callers to "inject" flag values, where flag values are first extracted from the command arguments, then from the global arguments as a fallback.
This commit is contained in:
@@ -13,6 +13,7 @@ import '../artifacts.dart';
|
||||
import '../base/common.dart';
|
||||
import '../base/context.dart';
|
||||
import '../base/file_system.dart';
|
||||
import '../base/flags.dart';
|
||||
import '../base/logger.dart';
|
||||
import '../base/os.dart';
|
||||
import '../base/platform.dart';
|
||||
@@ -163,6 +164,8 @@ class FlutterCommandRunner extends CommandRunner<Null> {
|
||||
|
||||
@override
|
||||
Future<Null> runCommand(ArgResults globalResults) async {
|
||||
context.setVariable(Flags, new Flags(globalResults));
|
||||
|
||||
// Check for verbose.
|
||||
if (globalResults['verbose']) {
|
||||
// Override the logger.
|
||||
|
||||
Reference in New Issue
Block a user