mirror of https://github.com/apache/maven.git
[MNG-7181] Make --version support -q
This commit is contained in:
parent
7b355f7223
commit
7a8acdd8e6
|
@ -75,6 +75,13 @@ public final class CLIReportingUtils
|
|||
return version.toString();
|
||||
}
|
||||
|
||||
public static String showVersionMinimal()
|
||||
{
|
||||
Properties properties = getBuildProperties();
|
||||
String version = reduce( properties.getProperty( BUILD_VERSION_PROPERTY ) );
|
||||
return ( version != null ? version : "<version unknown>" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a human readable string containing the Maven version, buildnumber, and time of build
|
||||
*
|
||||
|
|
|
@ -433,7 +433,14 @@ public class MavenCli
|
|||
|
||||
if ( cliRequest.commandLine.hasOption( CLIManager.VERSION ) )
|
||||
{
|
||||
System.out.println( CLIReportingUtils.showVersion() );
|
||||
if ( cliRequest.commandLine.hasOption( CLIManager.QUIET ) )
|
||||
{
|
||||
System.out.println( CLIReportingUtils.showVersionMinimal() );
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.println( CLIReportingUtils.showVersion() );
|
||||
}
|
||||
throw new ExitException( 0 );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue