equal
deleted
inserted
replaced
11 |
11 |
12 private static final Logger log = Logger.getLogger(CLIStarter.class.getName()); |
12 private static final Logger log = Logger.getLogger(CLIStarter.class.getName()); |
13 |
13 |
14 public static void main(String[] args) { |
14 public static void main(String[] args) { |
15 try { |
15 try { |
|
16 /** Parse options */ |
16 CLIParser parser = new CLIParser(); |
17 CLIParser parser = new CLIParser(); |
17 CLIOptions options = parser.parseOptions(args); |
18 CLIOptions options = parser.parseOptions(args); |
|
19 |
|
20 |
|
21 options.validate(); |
|
22 |
|
23 /** Show info */ |
|
24 if (!options.getShowInfo().isEmpty()) { |
|
25 InfoLister infoLister = new InfoLister(); |
|
26 infoLister.showInfo(options.getShowInfo(), System.err); |
|
27 } |
|
28 |
18 } catch (CLIParserException e) { |
29 } catch (CLIParserException e) { |
19 log.log(Level.SEVERE, null, e); |
30 log.log(Level.SEVERE, "Unable to parse CLI options", e); |
|
31 } catch (InvalidOptionsException e) { |
|
32 log.log(Level.SEVERE, "Invalid CLI options", e); |
20 } |
33 } |
21 } |
34 } |
22 } |
35 } |