<file_sep>package com.base.batch.test;

import com.base.batch.Config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Test {
    private static Logger logger = LoggerFactory.getLogger(Test.class);

    public static void main(String[] args) {
        logger.info("test");
        logger.info(Config.getInstance().getConfig().getString("test"));
    }
}

<file_sep>package com.base.batch;

import org.apache.commons.cli.CommandLine;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Iterator;

public class BatchTasklet {
    private Logger logger = LoggerFactory.getLogger(this.getClass());
    private String[] args;

    public BatchTasklet(String[] args) {
        this.args = args;
    }

    public void getTasksValues() {
        for (Tasks task : Tasks.list()) {
            logger.info("Task : {}", task.getValue());
        }
    }

    public void execute() {
        logger.info("{}", new Object[]{"Batch Base"});

        CliManager cliManager = new CliManager();
        CommandLine line = cliManager.startCli(args);

        //help
        if (line.hasOption("h")) {
            cliManager.printHelp(cliManager.getOptions());
            System.exit(0);
        }

        //version
        if (line.hasOption("v")) {
            cliManager.printVersion();
            System.exit(0);
        }

        //list-tasks
        if (line.hasOption("list-tasks")) {
            getTasksValues();
            System.exit(0);
        }

        //quiet mode
        if (line.hasOption("q")) {
            //quiet mode

        }

        //test mode
        if (line.hasOption("t")) {
            //test mode

        }

        //config-value
        if (line.hasOption("config-value")) {
            logger.info("config value");
            Iterator<String> keys = Config.getInstance().getConfig().getKeys();
            while(keys.hasNext()) {
                String key = keys.next();
                logger.info("{} => {}", new Object[]{key, Config.getInstance().getConfig().getString(key)});
            }

            System.exit(0);
        }

        //config-file
        if (line.hasOption("config-file")) {

            logger.info("use config file : {}", new Object[]{line.getOptionValue("config-file")});

            String test = Config.getInstance().getConfig().getString("test");
            logger.info("Config value : {}", new Object[]{test});

            System.exit(0);
        }

        //test-task
        if (line.hasOption("test-task")) {

            logger.info("use task name : {}", new Object[]{line.getOptionValue("test-task")});

            String test = Config.getInstance().getConfig().getString("test");
            logger.info("Config value : {}", new Object[]{test});

            System.exit(0);
        }

        if(line.getArgList().isEmpty()) {
            cliManager.printNoInput();
            System.exit(0);
        }
    }
}
