001package com.ganteater.ae.desktop;
002
003import java.io.IOException;
004
005import org.apache.commons.lang.ArrayUtils;
006
007import com.ganteater.ae.RecipeRunner;
008import com.ganteater.ae.TaskCancelingException;
009import com.ganteater.ae.desktop.ui.AEFrame;
010import com.ganteater.ae.util.AEUtils;
011
012/**
013 * Viktor_Tovstyi Date: Sep 7, 2006 Time: 10:24:58 AM
014 */
015public class Anteater {
016
017        public static void main(final String... args) throws IOException {
018
019                System.out.println("Starting Anteater Desktop Application - Version: " + AEUtils.getPrjProperty("application.version"));
020                
021                if (args.length > 0 && "/console".equalsIgnoreCase(args[0])) {
022                        String[] argStr = (String[]) ArrayUtils.subarray(args, 1, args.length);
023                        RecipeRunner.main(argStr);
024
025                } else {
026                        AEFrame theMainFrame = new AEFrame();
027                        try {
028                                theMainFrame.start();
029                                for (String taskFileName : args) {
030                                        theMainFrame.runTask(taskFileName);
031                                }
032                        } catch (TaskCancelingException e) {
033                                System.exit(0);
034                        } 
035                }
036        }
037
038}