You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by rw...@apache.org on 2013/10/16 14:10:38 UTC
svn commit: r1532743 -
/stanbol/trunk/commons/launchpad/src/main/java/org/apache/stanbol/launchpad/Main.java
Author: rwesten
Date: Wed Oct 16 12:10:38 2013
New Revision: 1532743
URL: http://svn.apache.org/r1532743
Log:
STANBOL-722: The Stanbol launchpad now prints Stanbol specific help when called with the -h option
Modified:
stanbol/trunk/commons/launchpad/src/main/java/org/apache/stanbol/launchpad/Main.java
Modified: stanbol/trunk/commons/launchpad/src/main/java/org/apache/stanbol/launchpad/Main.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/commons/launchpad/src/main/java/org/apache/stanbol/launchpad/Main.java?rev=1532743&r1=1532742&r2=1532743&view=diff
==============================================================================
--- stanbol/trunk/commons/launchpad/src/main/java/org/apache/stanbol/launchpad/Main.java (original)
+++ stanbol/trunk/commons/launchpad/src/main/java/org/apache/stanbol/launchpad/Main.java Wed Oct 16 12:10:38 2013
@@ -25,6 +25,8 @@ import java.security.ProtectionDomain;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import java.util.Map;
+
import static org.apache.sling.launchpad.base.shared.SharedConstants.SLING_HOME;
public class Main {
@@ -35,6 +37,11 @@ public class Main {
*/
public static final String NOSECURITYARG = "-no-security";
/**
+ * this
+ */
+ private static final String PRINTHELPARG = "-h";
+
+ /**
* @param args
*/
public static void main(String[] args) {
@@ -45,6 +52,10 @@ public class Main {
System.setProperty(SLING_HOME, home);
} //else do not override user configured values
List<String> argsList = new ArrayList<String>(Arrays.asList(args));
+ if(argsList.contains(PRINTHELPARG)){
+ doHelp();
+ System.exit(0);
+ }
if (argsList.contains(NOSECURITYARG)) {
argsList.remove(NOSECURITYARG);
} else {
@@ -62,5 +73,25 @@ public class Main {
//now use the standard Apache Sling launcher to do the job
org.apache.sling.launchpad.app.Main.main(argsList.toArray(new String[argsList.size()]));
}
+ /** copied form {@link org.apache.sling.launchpad.app.Main} and extended for Stanbol options */
+ private static void doHelp() {
+ System.out.println("usage: "
+ + Main.class.getName()
+ + " [ start | stop | status ] [ -j adr ] [ -l loglevel ] [ -f logfile ] [ -c slinghome ] [ -i launchpadhome ] [ -a address ] [ -p port ] [-no-security] { -Dn=v } [ -h ]");
+ System.out.println(" start listen for control connection (uses -j)");
+ System.out.println(" stop terminate running Apache Stanbol (uses -j)");
+ System.out.println(" status check whether Apache Stanbol is running (uses -j)");
+ System.out.println(" -j adr host and port to use for control connection in the format '[host:]port' (default 127.0.0.1:0)");
+ System.out.println(" -l loglevel the initial loglevel (0..4, FATAL, ERROR, WARN, INFO, DEBUG)");
+ System.out.println(" -f logfile the log file, \"-\" for stdout (default logs/error.log)");
+ System.out.println(" -c slinghome the Stamnol context directory (default stanbol)");
+ System.out.println(" -i launchpadhome the launchpad directory (default slinghome)");
+ System.out.println(" -a address the interfact to bind to (use 0.0.0.0 for any)");
+ System.out.println(" -p port the port to listen to (default 8080)");
+ System.out.println(" -r path the root servlet context path for the http service (default is /)");
+ System.out.println(" -no-security runs Stanbol without a security manager");
+ System.out.println(" -Dn=v sets java system property 'n' to value 'v'");
+ System.out.println(" -h prints this usage message");
+ }
}