mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
add a --quiet option to flutter_tools (#4213)
This commit is contained in:
parent
502f734dee
commit
d6aed1e7c9
@ -11,6 +11,8 @@ final AnsiTerminal terminal = new AnsiTerminal();
|
||||
abstract class Logger {
|
||||
bool get isVerbose => false;
|
||||
|
||||
bool quiet = false;
|
||||
|
||||
set supportsColor(bool value) {
|
||||
terminal.supportsColor = value;
|
||||
}
|
||||
|
@ -412,7 +412,8 @@ class _RunAndStayResident {
|
||||
|
||||
_handleExit();
|
||||
} else {
|
||||
_printHelp();
|
||||
if (!logger.quiet)
|
||||
_printHelp();
|
||||
|
||||
terminal.singleCharMode = true;
|
||||
|
||||
|
@ -34,6 +34,10 @@ class FlutterCommandRunner extends CommandRunner {
|
||||
abbr: 'v',
|
||||
negatable: false,
|
||||
help: 'Noisy logging, including all shell commands executed.');
|
||||
argParser.addFlag('quiet',
|
||||
negatable: false,
|
||||
hide: !verboseHelp,
|
||||
help: 'Reduce the amount of output from some commands.');
|
||||
argParser.addOption('device-id',
|
||||
abbr: 'd',
|
||||
help: 'Target device id.');
|
||||
@ -129,6 +133,8 @@ class FlutterCommandRunner extends CommandRunner {
|
||||
if (globalResults['verbose'])
|
||||
context[Logger] = new VerboseLogger();
|
||||
|
||||
logger.quiet = globalResults['quiet'];
|
||||
|
||||
if (globalResults.wasParsed('color'))
|
||||
logger.supportsColor = globalResults['color'];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user