| 95 | } |
| 96 | |
| 97 | private static CommandLine parseOptions(String[] args) throws ParseException { |
| 98 | Options options = new Options(); |
| 99 | |
| 100 | options.addOption( |
| 101 | Option.builder("h").longOpt("help").desc("Provide help").build()); |
| 102 | options.addOption( |
| 103 | Option.builder("o").longOpt("output").desc("Output filename") |
| 104 | .hasArg().build()); |
| 105 | CommandLine cli = new DefaultParser().parse(options, args); |
| 106 | if (cli.hasOption('h')) { |
| 107 | HelpFormatter formatter = new HelpFormatter(); |
| 108 | formatter.printHelp("key", options); |
| 109 | System.exit(1); |
| 110 | } |
| 111 | return cli; |
| 112 | } |
| 113 | |
| 114 | public static void main(Configuration conf, |
| 115 | String[] args |