Classes with static main

Checking command line arguments

private static final String OUTPUT_FILE = "output";

OptionSet optionSet = checkArgs(args);

String outFile = optionSet.valueOf(OUTPUT_FILE).toString();

private static OptionSet checkArgs(String[] args) throws IOException {
        OptionParser optionParser = new OptionParser(){
            {
                accepts(OUTPUT_FILE).withRequiredArg().ofType(String.class).required().describedAs("output file");
            }
        };
        
        try {
            return  optionParser.parse(args);    
        
        }catch(OptionException e){
            logger.error("Invalid arguments:");
            optionParser.printHelpOn(System.out);
            throw e;
        }
           
    }