stefano 2003/02/20 12:10:32 Modified: src/java/org/apache/cocoon Main.java Log: nicer command line messages Revision Changes Path 1.33 +24 -22 xml-cocoon2/src/java/org/apache/cocoon/Main.java Index: Main.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/Main.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- Main.java 2 Feb 2003 00:46:20 -0000 1.32 +++ Main.java 20 Feb 2003 20:10:32 -0000 1.33 @@ -204,15 +204,13 @@ List targets = new ArrayList(); String logKit = null; String logger = null; - String logLevel = "DEBUG"; + String logLevel = "ERROR"; String agentOptions = null; String acceptOptions = null; boolean precompileOnly = false; boolean followLinks = true; boolean verbose = false; - System.out.print("\nSetup..."); - CLArgsParser parser = new CLArgsParser(args, OPTIONS); List clOptions = parser.getArguments(); int size = clOptions.size(); @@ -234,7 +232,7 @@ break; case Main.VERSION_OPT: - printVersion(CocoonBean.getVersion()); + printVersion(); break; case Main.VERBOSE_OPT: @@ -335,40 +333,36 @@ System.exit(1); } + System.out.println(getProlog()); + cocoon.initialize(); - System.out.println(" done."); - - System.out.print("Initializing..."); cocoon.warmup(); - - System.out.println(" ready, let's go :-)"); cocoon.process(targets, new FileDestination(destDir)); - - System.out.print("\ndisposing..."); cocoon.dispose(); - System.out.println(" done."); System.exit(0); } /** - * Print the version string and exit + * Print a description of the software before running */ - private static void printVersion(String version) { - System.out.println(version); - System.exit(0); + private static String getProlog() { + String lSep = System.getProperty("line.separator"); + StringBuffer msg = new StringBuffer(); + msg.append("------------------------------------------------------------------------ ").append(lSep); + msg.append(Constants.NAME).append(" ").append(Constants.VERSION).append(lSep); + msg.append("Copyright (c) ").append(Constants.YEAR).append(" Apache Software Foundation. All rights reserved.").append(lSep); + msg.append("------------------------------------------------------------------------ ").append(lSep).append(lSep); + return msg.toString(); } - + /** * Print the usage message and exit */ private static void printUsage() { String lSep = System.getProperty("line.separator"); StringBuffer msg = new StringBuffer(); - msg.append("------------------------------------------------------------------------ ").append(lSep); - msg.append(Constants.NAME).append(" ").append(Constants.VERSION).append(lSep); - msg.append("Copyright (c) ").append(Constants.YEAR).append(" Apache Software Foundation. All rights reserved.").append(lSep); - msg.append("------------------------------------------------------------------------ ").append(lSep).append(lSep); + msg.append(getProlog()); msg.append("Usage: java org.apache.cocoon.Main [options] [targets]").append(lSep).append(lSep); msg.append("Options: ").append(lSep); msg.append(CLUtil.describeOptions(Main.OPTIONS).toString()); @@ -376,4 +370,12 @@ System.out.println(msg.toString()); System.exit(0); } + + /** + * Print the version string and exit + */ + private static void printVersion() { + System.out.println(Constants.VERSION); + System.exit(0); + } }
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]