Author: rwesten
Date: Tue Oct 22 09:33:57 2013
New Revision: 1534562

URL: http://svn.apache.org/r1534562
Log:
STANBOL-1094: re-added the fix for STANBOL-722

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=1534562&r1=1534561&r2=1534562&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
 Tue Oct 22 09:33:57 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");
+    }
 }


Reply via email to