package org.josast.ApplicationSatelliteDatabaseCli;

import java.util.Vector;

import org.apache.commons.cli.ParseException;

import org.josast.ApplicationSatelliteDatabaseCli.cmd.Cmd;
import org.josast.ApplicationSatelliteDatabaseCli.cmd.OptionsAnalysis;

/**
 * Classe Java for mergin AMSAT-LIST Xml file.
 *  Concept : read all files from a directory add this file data in memory save all data in one file.
 * @author Christophe
 *
 */

/**
 * @author christophe
 *
 */
public class AppCli {

    /**
     * vec list of command.
     */
   private  Vector<Cmd> vec = null;

    /**
     * Initialise analysis of option.
     * @param args
     */
    public AppCli(final String[] args) {
        OptionsAnalysis opt = new OptionsAnalysis(args);
        vec = opt.getCommandes();

    }

    /**
     *  launch all commande store in vec.
     */
    private void execute() {
        for (Cmd cmd : vec) {
            cmd.excute();
        }

    }

    /**
     * @param args
     * @throws ParseException
     */
    public static void main(String[] args) throws ParseException {

        AppCli app = new AppCli(args);
        app.execute();

    }

}
