Revision: 2460
          http://vexi.svn.sourceforge.net/vexi/?rev=2460&view=rev
Author:   mkpg2
Date:     2007-10-14 16:50:26 -0700 (Sun, 14 Oct 2007)

Log Message:
-----------
Set main template using option (-t), avoiding the previous guessing nonsense.

Modified Paths:
--------------
    trunk/core/org.vexi.core/src/org/vexi/core/Main.java

Modified: trunk/core/org.vexi.core/src/org/vexi/core/Main.java
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/core/Main.java        2007-10-14 
23:30:46 UTC (rev 2459)
+++ trunk/core/org.vexi.core/src/org/vexi/core/Main.java        2007-10-14 
23:50:26 UTC (rev 2460)
@@ -53,6 +53,7 @@
     //private static final String prefsFileName = "prefs";
 
     static public final String CORE_OPTIONS =    
+    "    -t <template>   set the template to execute, default is 'main'" +
     "    -l <level>      set logging level to { debug, info (default), warn, 
error, silent }\n"+
     "    -l rpc          log all XML-RPC and SOAP conversations\n"+
     "    -l host:port    emit log to TCP socket\n"+
@@ -79,13 +80,16 @@
 
     }
     public static Fountain init(String[] args) throws Exception {
-       
+        String startupTemplate = null;
        int startargs = 0;
         while (true) {
             if (startargs > args.length - 1) printUsage();
             else if (args[startargs].equals("-a")) ;//DISABLED 
JS.checkAssertions = true;
-            else if (args[startargs].equals("-l")) {
+            else if (args[startargs].equals("-t")) {
                 startargs++;
+                startupTemplate = args[startargs];
+            }else if (args[startargs].equals("-l")) {
+                startargs++;
                 String[] opts = args[startargs].split(",");
                 for(int i=0; i<opts.length; i++){
                     String opt = opts[i];
@@ -122,7 +126,7 @@
         // INTERPRET ARGUMENTS
         // create resource root, adding vexipaths into one multifountain
         // 
-        String startupTemplate = null;
+
         for (int i=startargs; i<args.length; i++) {
             if (args[i].indexOf('=') != -1) {
                 loadParam(args[i]);
@@ -144,12 +148,8 @@
                         //initialTemplate = "org.vexi.builtin.splash";
                     }
                 }
-                else if (i == args.length-1 && startupTemplate==null) {
-                    startupTemplate = args[i];
-                }
                 else {
-                                       Log.uError(Main.class, "Invalid 
parameter (either second template name or "+
-                                               "non existing file name: "+ 
args[i]);
+                                       Log.uWarn(Main.class, "[Error] 
Non-existent location: "+ args[i]);
                 }
             }
         }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to