Author: brett Date: Tue Aug 8 18:46:31 2006 New Revision: 429921 URL: http://svn.apache.org/viewvc?rev=429921&view=rev Log: port r429917 from branch - add a quiet option for the CLI
Modified: maven/components/trunk/maven-cli/src/main/java/org/apache/maven/cli/CLIManager.java maven/components/trunk/maven-cli/src/main/java/org/apache/maven/cli/MavenCli.java Modified: maven/components/trunk/maven-cli/src/main/java/org/apache/maven/cli/CLIManager.java URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-cli/src/main/java/org/apache/maven/cli/CLIManager.java?rev=429921&r1=429920&r2=429921&view=diff ============================================================================== --- maven/components/trunk/maven-cli/src/main/java/org/apache/maven/cli/CLIManager.java (original) +++ maven/components/trunk/maven-cli/src/main/java/org/apache/maven/cli/CLIManager.java Tue Aug 8 18:46:31 2006 @@ -30,6 +30,8 @@ public static final char REACTOR = 'r'; + public static final char QUIET = 'q'; + public static final char DEBUG = 'X'; public static final char ERRORS = 'e'; @@ -83,6 +85,9 @@ options.addOption( OptionBuilder.withLongOpt( "version" ).withDescription( "Display version information" ).create( VERSION ) ); + options.addOption( + OptionBuilder.withLongOpt( "quiet" ).withDescription( "Quiet output - only show warnings and errors" ).create( + QUIET ) ); options.addOption( OptionBuilder.withLongOpt( "debug" ).withDescription( "Produce execution debug output" ).create( DEBUG ) ); Modified: maven/components/trunk/maven-cli/src/main/java/org/apache/maven/cli/MavenCli.java URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-cli/src/main/java/org/apache/maven/cli/MavenCli.java?rev=429921&r1=429920&r2=429921&view=diff ============================================================================== --- maven/components/trunk/maven-cli/src/main/java/org/apache/maven/cli/MavenCli.java (original) +++ maven/components/trunk/maven-cli/src/main/java/org/apache/maven/cli/MavenCli.java Tue Aug 8 18:46:31 2006 @@ -170,6 +170,13 @@ { recursive = false; } + else if ( commandLine.hasOption( CLIManager.QUIET ) ) + { + // TODO: we need to do some more work here. Some plugins use sys out or log errors at info level. + // Ideally, we could use Warn across the board + loggerManager.setThreshold( Logger.LEVEL_ERROR ); + // TODO:Additionally, we can't change the mojo level because the component key includes the version and it isn't known ahead of time. This seems worth changing. + } if ( commandLine.hasOption( CLIManager.FAIL_FAST ) ) {