Add --help flag

This commit is contained in:
md_5 2019-03-17 12:43:12 +11:00
parent caeabb5b62
commit 52a125dded

View File

@ -23,11 +23,17 @@ public class BungeeCordLauncher
OptionParser parser = new OptionParser();
parser.allowsUnrecognizedOptions();
parser.acceptsAll( Arrays.asList( "v", "version" ) );
parser.acceptsAll( Arrays.asList( "noconsole" ) );
parser.acceptsAll( Arrays.asList( "help" ), "Show the help" );
parser.acceptsAll( Arrays.asList( "v", "version" ), "Print version and exit" );
parser.acceptsAll( Arrays.asList( "noconsole" ), "Disable console input" );
OptionSet options = parser.parse( args );
if ( options.has( "help" ) )
{
parser.printHelpOn( System.out );
return;
}
if ( options.has( "version" ) )
{
System.out.println( BungeeCord.class.getPackage().getImplementationVersion() );