Package org.apache.commons.cli

Examples of org.apache.commons.cli.CommandLine


    static GenerateCreateTableTask.Configuration parseConfiguration(String... args) throws ParseException {
        LOG.debug("Analyzing arguments: {}", Arrays.toString(args));

        CommandLineParser parser = new BasicParser();
        CommandLine cmd = parser.parse(OPTIONS, args);
        String classpath = getOption(cmd, OPT_CLASSPATH);
        String pluginpath = getOption(cmd, OPT_PLUGINPATH);
        String output = getOption(cmd, OPT_OUTPUT);
        String include = getOption(cmd, OPT_INCLUDE);
        String location = getOption(cmd, OPT_LOCATION);
View Full Code Here


    static int start(String... args) {
        assert args != null;
        GenerateTask task;
        try {
            CommandLineParser parser = new BasicParser();
            CommandLine cmd = parser.parse(OPTIONS, args);
            TemplateGenerator generator = getGenerator(cmd);
            DmdlSourceRepository repository = getRepository(cmd);
            ClassLoader classLoader = getClassLoader(cmd);
            task = new GenerateTask(generator, repository, classLoader);
        } catch (Exception e) {
View Full Code Here

    }

    static Configuration parseConfiguration(String[] args) throws ParseException {
        assert args != null;
        CommandLineParser parser = new BasicParser();
        CommandLine cmd = parser.parse(OPTIONS, args);

        String batchId = cmd.getOptionValue(OPT_BATCH_ID.getOpt());
        String flowId = cmd.getOptionValue(OPT_FLOW_ID.getOpt());
        Properties arguments = cmd.getOptionProperties(OPT_ARGUMENT.getOpt());

        SortedMap<String, String> pairs = new TreeMap<String, String>();
        for (Map.Entry<Object, Object> entry : arguments.entrySet()) {
            Object key = entry.getKey();
            Object value = entry.getValue();
View Full Code Here

    static Configuration parseConfiguration(String[] args) throws ParseException {
        assert args != null;
        LOG.debug("Analyzing YAESS Explain arguments: {}", Arrays.toString(args));

        CommandLineParser parser = new BasicParser();
        CommandLine cmd = parser.parse(OPTIONS, args);

        String script = cmd.getOptionValue(OPT_SCRIPT.getOpt());
        LOG.debug("Script: {}", script);

        Configuration result = new Configuration();
        LOG.debug("Loading script: {}", script);
        try {
View Full Code Here

    }

    static Arguments parseArguments(String[] args) throws ParseException {
        assert args != null;
        CommandLineParser parser = new BasicParser();
        CommandLine cmd = parser.parse(OPTIONS, args);

        String batchId = cmd.getOptionValue(OPT_BATCH_ID.getOpt());
        LOG.debug("Batch ID: {}", batchId);

        String executionIdPrefix = generateExecutionId();
        LOG.debug("Exec ID (prefix): {}", batchId);

        Properties arguments = cmd.getOptionProperties(OPT_ARGUMENT.getOpt());
        LOG.debug("Batch arguments: {}", arguments);

        TestDriverContext context = createContext();
        context.getBatchArgs().putAll(toMap(arguments));
View Full Code Here

    static Configuration parseConfiguration(String[] args) throws ParseException {
        assert args != null;
        LOG.debug("Analyzing arguments: {}", Arrays.toString(args));

        CommandLineParser parser = new BasicParser();
        CommandLine cmd = parser.parse(OPTIONS, args);

        ClassLoader classLoader = Main.class.getClassLoader();

        YaessLogInput source = create(cmd, OPT_INPUT, YaessLogInput.class, classLoader);
        YaessLogOutput sink = create(cmd, OPT_OUTPUT, YaessLogOutput.class, classLoader);
View Full Code Here

    static Configuration parseConfiguration(String[] args) throws ParseException {
        assert args != null;
        LOG.debug("Analyzing YAESS bootstrap arguments: {}", Arrays.toString(args));

        CommandLineParser parser = new BasicParser();
        CommandLine cmd = parser.parse(OPTIONS, args);

        String profile = cmd.getOptionValue(OPT_PROFILE.getOpt());
        LOG.debug("Profile: {}", profile);
        String script = cmd.getOptionValue(OPT_SCRIPT.getOpt());
        LOG.debug("Script: {}", script);
        String batchId = cmd.getOptionValue(OPT_BATCH_ID.getOpt());
        LOG.debug("Batch ID: {}", batchId);
        String flowId = cmd.getOptionValue(OPT_FLOW_ID.getOpt());
        LOG.debug("Flow ID: {}", flowId);
        String executionId = cmd.getOptionValue(OPT_EXECUTION_ID.getOpt());
        LOG.debug("Execution ID: {}", executionId);
        String phaseName = cmd.getOptionValue(OPT_PHASE_NAME.getOpt());
        LOG.debug("Phase name: {}", phaseName);
        String plugins = cmd.getOptionValue(OPT_PLUGIN.getOpt());
        LOG.debug("Plug-ins: {}", plugins);
        Properties arguments = cmd.getOptionProperties(OPT_ARGUMENT.getOpt());
        LOG.debug("Execution arguments: {}", arguments);
        Properties definitions = cmd.getOptionProperties(OPT_DEFINITION.getOpt());
        LOG.debug("Execution definitions: {}", definitions);

        LOG.debug("Loading plugins: {}", plugins);
        List<File> pluginFiles = CommandLineUtil.parseFileList(plugins);
        ClassLoader loader = CommandLineUtil.buildPluginLoader(Yaess.class.getClassLoader(), pluginFiles);
View Full Code Here

    }

    static Configuration configure(String[] args) throws ParseException {
        assert args != null;
        CommandLineParser parser = new BasicParser();
        CommandLine cmd = parser.parse(OPTIONS, args);
        String output = cmd.getOptionValue(OPT_OUTPUT.getOpt());
        String packageName = cmd.getOptionValue(OPT_PACKAGE.getOpt());
        Charset sourceEnc = parseCharset(cmd.getOptionValue(OPT_SOURCE_ENCODING.getOpt()));
        Charset targetEnc = parseCharset(cmd.getOptionValue(OPT_TARGET_ENCODING.getOpt()));
        String sourcePaths = cmd.getOptionValue(OPT_SOURCE_PATH.getOpt());
        String plugin = cmd.getOptionValue(OPT_PLUGIN.getOpt());

        File outputDirectory = new File(output);
        DmdlSourceRepository source = buildRepository(parseFileList(sourcePaths), sourceEnc);
        ClassLoader serviceLoader = buildPluginLoader(Main.class.getClassLoader(), parseFileList(plugin));
View Full Code Here

        if (LOG.isDebugEnabled()) {
            LOG.debug("Parsing options: {}", Arrays.toString(args));
        }

        CommandLineParser parser = new BasicParser();
        CommandLine cmd = parser.parse(OPTIONS, args);

        boolean recursive = cmd.hasOption(OPT_RECURSIVE.getOpt());
        String keepString = cmd.getOptionValue(OPT_KEEP_DAYS.getOpt());
        boolean dryRun = cmd.hasOption(OPT_DRY_RUN.getOpt());
        String[] rest = cmd.getArgs();

        if (keepString == null) {
            LOG.error(MessageFormat.format(
                    "[OT-CLEAN-E00001] Missing option: -{0}",
                    OPT_KEEP_DAYS.getLongOpt()));
View Full Code Here

     * @throws IllegalStateException 復元に失敗した場合
     */
    public static Configuration loadConfigurationFromArguments(String[] args) {
        assert args != null;
        CommandLineParser parser = new BasicParser();
        CommandLine cmd;
        try {
            cmd = parser.parse(OPTIONS, args);
        } catch (ParseException e) {
            throw new IllegalStateException(e);
        }
View Full Code Here

TOP

Related Classes of org.apache.commons.cli.CommandLine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.