mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-24 03:05:49 +01:00
Add --help flag
This commit is contained in:
parent
caeabb5b62
commit
52a125dded
@ -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() );
|
||||
|
Loading…
Reference in New Issue
Block a user