craigmcc    00/11/27 16:19:23

  Modified:    src/share/org/apache/tomcat/resources Tag: tomcat_32
                        LocalStrings.properties
               src/share/org/apache/tomcat/startup Tag: tomcat_32
                        Tomcat.java
  Log:
  Improve the usage comments of the Tomcat startup class, if the "-help"
  option is used, or if an invalid command line is entered.
  PR: BugRat Bug Report #429
  Submitted by: Ralf Suckow <[EMAIL PROTECTED]>
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.5   +3 -3      
jakarta-tomcat/src/share/org/apache/tomcat/resources/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/resources/LocalStrings.properties,v
  retrieving revision 1.4.2.4
  retrieving revision 1.4.2.5
  diff -u -r1.4.2.4 -r1.4.2.5
  --- LocalStrings.properties   2000/11/09 21:42:55     1.4.2.4
  +++ LocalStrings.properties   2000/11/28 00:19:15     1.4.2.5
  @@ -1,4 +1,4 @@
  -# $Id: LocalStrings.properties,v 1.4.2.4 2000/11/09 21:42:55 larryi Exp $
  +# $Id: LocalStrings.properties,v 1.4.2.5 2000/11/28 00:19:15 craigmcc Exp $
   #
   
   # Localized strings for package org.apache.tomcat.core
  @@ -29,11 +29,11 @@
   dispatcher.includeException=Included servlet threw exception
   
   #Tomcat.java
  -tomcat.usage=usage: 
  +tomcat.usage=Usage: java org.apache.tomcat.startup.Tomcat options
   tomcat.start=Starting tomcat. Check logs/tomcat.log for error messages 
   tomcat.fatalconfigerror=FATAL: configuration error
   tomcat.nohome=No tomcat.home property, you need to set TOMCAT_HOME or add 
-Dtomcat.home
  -tomcat.wrongargs=Wrong arguments
  +tomcat.wrongargs=Wrong arguments: type tomcat -help for valid options
   tomcat.stop=Stop tomcat
   tomcat.fatal=FATAL:
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.31.2.1  +19 -6     jakarta-tomcat/src/share/org/apache/tomcat/startup/Tomcat.java
  
  Index: Tomcat.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Tomcat.java,v
  retrieving revision 1.31
  retrieving revision 1.31.2.1
  diff -u -r1.31 -r1.31.2.1
  --- Tomcat.java       2000/06/23 01:21:57     1.31
  +++ Tomcat.java       2000/11/28 00:19:20     1.31.2.1
  @@ -166,8 +166,6 @@
   
       public void execute(String args[] ) throws Exception {
        if( ! processArgs( args ) ) {
  -         System.out.println(sm.getString("tomcat.wrongargs"));
  -         printUsage();
            return;
        }
   
  @@ -278,7 +276,12 @@
       boolean doStop=false;
       
       public static void printUsage() {
  -     System.out.println(sm.getString("tomcat.usage"));
  +        System.out.println("Usage: java org.apache.tomcat.startup.Tomcat 
{options}");
  +        System.out.println("  Options are:");
  +        System.out.println("    -config file (or -f file)  Use this file instead of 
server.xml");
  +        System.out.println("    -help (or help)            Show this usage report");
  +        System.out.println("    -home dir (or -h dir)      Use this directory as 
tomcat.home");
  +        System.out.println("    -stop                      Shut down currently 
running Tomcat");
       }
   
       /** Process arguments - set object properties from the list of args.
  @@ -290,17 +293,27 @@
            if (arg.equals("-help") || arg.equals("help")) {
                printUsage();
                return false;
  -             
            } else if (arg.equals("-stop")) {
                doStop=true;
            } else if (arg.equals("-f") || arg.equals("-config")) {
                i++;
  -             if( i < args.length )
  +             if( i < args.length ) {
                    configFile = args[i];
  +                } else {
  +                    printUsage();
  +                    return (false);
  +                }
            } else if (arg.equals("-h") || arg.equals("-home")) {
                i++;
  -             if (i < args.length)
  +             if (i < args.length) {
                    System.getProperties().put("tomcat.home", args[i]);
  +                } else {
  +                    printUsage();
  +                    return (false);
  +                }
  +            } else {
  +                printUsage();
  +                return false;
            }
        }
        return true;
  
  
  

Reply via email to