Chromium Code Reviews

Unified Diff: lib/src/command_runner.dart

Issue 1267853002: Add verbosity levels for warnings and errors. (Closed) Base URL: https://github.com/dart-lang/pub.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « no previous file | lib/src/git.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/command_runner.dart
diff --git a/lib/src/command_runner.dart b/lib/src/command_runner.dart
index 19d8cf4d18974898c89886ff9f971687d0e44e8f..6a07d50a4660d590844720e20fd4bfa4a6cad556 100644
--- a/lib/src/command_runner.dart
+++ b/lib/src/command_runner.dart
@@ -45,12 +45,14 @@ class PubCommandRunner extends CommandRunner {
help: 'Print debugging information when an error occurs.');
argParser.addOption('verbosity',
help: 'Control output verbosity.',
- allowed: ['normal', 'io', 'solver', 'all'],
+ allowed: ['error', 'warning', 'normal', 'io', 'solver', 'all'],
allowedHelp: {
- 'normal': 'Show errors, warnings, and user messages.',
- 'io': 'Also show IO operations.',
- 'solver': 'Show steps during version resolution.',
- 'all': 'Show all output including internal tracing messages.'
+ 'error': 'Show only errors.',
+ 'warning': 'Show only errors and warnings.',
+ 'normal': 'Show errors, warnings, and user messages.',
+ 'io': 'Also show IO operations.',
+ 'solver': 'Show steps during version resolution.',
+ 'all': 'Show all output including internal tracing messages.'
});
argParser.addFlag('verbose', abbr: 'v', negatable: false,
help: 'Shortcut for "--verbosity=all".');
@@ -99,10 +101,12 @@ class PubCommandRunner extends CommandRunner {
}
switch (options['verbosity']) {
- case 'normal': log.verbosity = log.Verbosity.NORMAL; break;
- case 'io': log.verbosity = log.Verbosity.IO; break;
- case 'solver': log.verbosity = log.Verbosity.SOLVER; break;
- case 'all': log.verbosity = log.Verbosity.ALL; break;
+ case 'error': log.verbosity = log.Verbosity.ERROR; break;
+ case 'warning': log.verbosity = log.Verbosity.WARNING; break;
+ case 'normal': log.verbosity = log.Verbosity.NORMAL; break;
+ case 'io': log.verbosity = log.Verbosity.IO; break;
+ case 'solver': log.verbosity = log.Verbosity.SOLVER; break;
+ case 'all': log.verbosity = log.Verbosity.ALL; break;
default:
// No specific verbosity given, so check for the shortcut.
if (options['verbose']) log.verbosity = log.Verbosity.ALL;
« no previous file with comments | « no previous file | lib/src/git.dart » ('j') | no next file with comments »

Powered by Google App Engine