Commit d6aed1e7 authored by Devon Carew's avatar Devon Carew

add a --quiet option to flutter_tools (#4213)

parent 502f734d
...@@ -11,6 +11,8 @@ final AnsiTerminal terminal = new AnsiTerminal(); ...@@ -11,6 +11,8 @@ final AnsiTerminal terminal = new AnsiTerminal();
abstract class Logger { abstract class Logger {
bool get isVerbose => false; bool get isVerbose => false;
bool quiet = false;
set supportsColor(bool value) { set supportsColor(bool value) {
terminal.supportsColor = value; terminal.supportsColor = value;
} }
......
...@@ -412,7 +412,8 @@ class _RunAndStayResident { ...@@ -412,7 +412,8 @@ class _RunAndStayResident {
_handleExit(); _handleExit();
} else { } else {
_printHelp(); if (!logger.quiet)
_printHelp();
terminal.singleCharMode = true; terminal.singleCharMode = true;
......
...@@ -34,6 +34,10 @@ class FlutterCommandRunner extends CommandRunner { ...@@ -34,6 +34,10 @@ class FlutterCommandRunner extends CommandRunner {
abbr: 'v', abbr: 'v',
negatable: false, negatable: false,
help: 'Noisy logging, including all shell commands executed.'); 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', argParser.addOption('device-id',
abbr: 'd', abbr: 'd',
help: 'Target device id.'); help: 'Target device id.');
...@@ -129,6 +133,8 @@ class FlutterCommandRunner extends CommandRunner { ...@@ -129,6 +133,8 @@ class FlutterCommandRunner extends CommandRunner {
if (globalResults['verbose']) if (globalResults['verbose'])
context[Logger] = new VerboseLogger(); context[Logger] = new VerboseLogger();
logger.quiet = globalResults['quiet'];
if (globalResults.wasParsed('color')) if (globalResults.wasParsed('color'))
logger.supportsColor = globalResults['color']; logger.supportsColor = globalResults['color'];
......
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