From 52a125dded7eccdb9bdfbfca5d801046efda0924 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 17 Mar 2019 12:43:12 +1100 Subject: [PATCH] Add --help flag --- .../main/java/net/md_5/bungee/BungeeCordLauncher.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java index c38b8fc2..13f9812f 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCordLauncher.java @@ -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() );