Add --help flag
This commit is contained in:
parent
caeabb5b62
commit
52a125dded
@ -23,11 +23,17 @@ public class BungeeCordLauncher
|
|||||||
|
|
||||||
OptionParser parser = new OptionParser();
|
OptionParser parser = new OptionParser();
|
||||||
parser.allowsUnrecognizedOptions();
|
parser.allowsUnrecognizedOptions();
|
||||||
parser.acceptsAll( Arrays.asList( "v", "version" ) );
|
parser.acceptsAll( Arrays.asList( "help" ), "Show the help" );
|
||||||
parser.acceptsAll( Arrays.asList( "noconsole" ) );
|
parser.acceptsAll( Arrays.asList( "v", "version" ), "Print version and exit" );
|
||||||
|
parser.acceptsAll( Arrays.asList( "noconsole" ), "Disable console input" );
|
||||||
|
|
||||||
OptionSet options = parser.parse( args );
|
OptionSet options = parser.parse( args );
|
||||||
|
|
||||||
|
if ( options.has( "help" ) )
|
||||||
|
{
|
||||||
|
parser.printHelpOn( System.out );
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ( options.has( "version" ) )
|
if ( options.has( "version" ) )
|
||||||
{
|
{
|
||||||
System.out.println( BungeeCord.class.getPackage().getImplementationVersion() );
|
System.out.println( BungeeCord.class.getPackage().getImplementationVersion() );
|
||||||
|
Loading…
Reference in New Issue
Block a user