1 /* Copyright (C) 2003 Vladimir Roubtsov. All rights reserved. 2 * 3 * This program and the accompanying materials are made available under 4 * the terms of the Common Public License v1.0 which accompanies this distribution, 5 * and is available at http://www.eclipse.org/legal/cpl-v10.html 6 * 7 * $Id: emma.java,v 1.1.1.1.2.1 2004/07/16 23:32:29 vlad_r Exp $ 8 */ 9 import com.vladium.emma.IAppConstants; 10 import com.vladium.emma.Command; 11 import com.vladium.emma.EMMARuntimeException; 12 13 // ---------------------------------------------------------------------------- 14 /** 15 * @author Vlad Roubtsov, (C) 2003 16 */ 17 public 18 final class emma 19 { 20 // public: ................................................................ 21 22 // TODO: set m_out consistently with LoggerInit 23 main(final String [] args)24 public static void main (final String [] args) 25 throws EMMARuntimeException 26 { 27 // TODO: proper usage, arg validation, etc 28 29 if ((args.length == 0) || args [0].startsWith ("-h")) 30 { 31 System.out.println (USAGE); 32 return; 33 } 34 35 final String commandName = args [0]; 36 final String [] commandArgs = new String [args.length - 1]; 37 System.arraycopy (args, 1, commandArgs, 0, commandArgs.length); 38 39 final Command command = Command.create (commandName, "emma ".concat (commandName), commandArgs); 40 command.run (); 41 } 42 43 // protected: ............................................................. 44 45 // package: ............................................................... 46 47 // private: ............................................................... 48 49 50 private static final String EOL = System.getProperty ("line.separator", "\n"); 51 52 private static final String USAGE = 53 "emma usage: emma <command> [command options]," + EOL + 54 " where <command> is one of:" + EOL + 55 EOL + 56 " run application runner {same as 'emmarun' tool};" + EOL + 57 " instr offline instrumentation processor;" + EOL + 58 " report offline report generator;" + EOL + 59 " merge offline data file merge processor." + EOL + 60 EOL + 61 " {use '<command> -h' to see usage help for a given command}" + EOL + 62 EOL + 63 IAppConstants.APP_USAGE_BUILD_ID; 64 65 } // end of class 66 // ----------------------------------------------------------------------------