final OptionParser parser = new OptionParser();
final OptionSpec<String> host = parser.accepts("host", "master host").withRequiredArg().ofType(String.class).defaultsTo(defaultHost);
final OptionSpec<Integer> port = parser.accepts("port", "master port").withRequiredArg().ofType(Integer.class).defaultsTo(defaultPort);
final OptionSpec<Integer> interval = parser.accepts("interval", "interval between successive executions").withRequiredArg().ofType(Integer.class);
final OptionSpec<Boolean> secure = parser.accepts("secure", "use secure connections").withRequiredArg().ofType(Boolean.class);
final OptionSpec<?> help = parser.acceptsAll(asList("h", "?", "help"), "show help").forHelp();
final OptionSpec<String> nonOption = parser.nonOptions(Mode.STANDBY + " <path to repository>");
final OptionSet options = parser.parse(args);
final List<String> nonOptions = nonOption.values(options);