final Options options = new Options();
options.addOption("h", "help", false, "Show this help");
options.addOption("m", "mode", true, "mode: normal | secondary | recovery | archive");
final CommandLineParser parser = new BasicParser();
final CommandLine cmd = parser.parse(options, args);
if (cmd.hasOption('h')) {
printHelp(options);
return;
}