franta-hg@1: package info.globalcode.sql.dk; franta-hg@1: franta-hg@13: import java.util.logging.Level; franta-hg@13: import java.util.logging.Logger; franta-hg@13: franta-hg@1: /** franta-hg@1: * franta-hg@1: * @author Ing. František Kučera (frantovo.cz) franta-hg@1: */ franta-hg@1: public class CLIStarter { franta-hg@1: franta-hg@13: private static final Logger log = Logger.getLogger(CLIStarter.class.getName()); franta-hg@13: franta-hg@1: public static void main(String[] args) { franta-hg@13: try { franta-hg@14: /** Parse options */ franta-hg@13: CLIParser parser = new CLIParser(); franta-hg@13: CLIOptions options = parser.parseOptions(args); franta-hg@14: franta-hg@14: franta-hg@14: options.validate(); franta-hg@14: franta-hg@14: /** Show info */ franta-hg@14: if (!options.getShowInfo().isEmpty()) { franta-hg@14: InfoLister infoLister = new InfoLister(); franta-hg@15: infoLister.showInfo(options, System.err); franta-hg@14: } franta-hg@14: franta-hg@13: } catch (CLIParserException e) { franta-hg@14: log.log(Level.SEVERE, "Unable to parse CLI options", e); franta-hg@14: } catch (InvalidOptionsException e) { franta-hg@14: log.log(Level.SEVERE, "Invalid CLI options", e); franta-hg@13: } franta-hg@4: } franta-hg@1: }