Package joptsimple

Examples of joptsimple.OptionParser.acceptsAll()


    public static void main(final String... args)
        throws IOException, ProcessingException
    {
        final OptionParser parser = new OptionParser();
        parser.accepts("help", "show this help").forHelp();
        parser.acceptsAll(Arrays.asList("s", "brief"),
            "only show validation status (OK/NOT OK)");
        parser.acceptsAll(Arrays.asList("q", "quiet"),
            "no output; exit with the relevant return code (see below)");
        parser.accepts("syntax",
            "check the syntax of schema(s) given as argument(s)");
View Full Code Here


    {
        final OptionParser parser = new OptionParser();
        parser.accepts("help", "show this help").forHelp();
        parser.acceptsAll(Arrays.asList("s", "brief"),
            "only show validation status (OK/NOT OK)");
        parser.acceptsAll(Arrays.asList("q", "quiet"),
            "no output; exit with the relevant return code (see below)");
        parser.accepts("syntax",
            "check the syntax of schema(s) given as argument(s)");
        parser.accepts("fakeroot",
            "pretend that the current directory is absolute URI \"uri\"")
View Full Code Here

        OptionParser parser = new OptionParser();
        OptionSpec<Integer> clusterId = parser.accepts("clusterId", "MongoMK clusterId")
                .withRequiredArg().ofType(Integer.class).defaultsTo(0);
        OptionSpec quiet = parser.accepts("quiet", "be less chatty");
        OptionSpec shell = parser.accepts("shell", "run the shell after executing files");
        OptionSpec help = parser.acceptsAll(asList("h", "?", "help"), "show help").forHelp();
        OptionSpec<String> nonOption = parser.nonOptions("console {<path-to-repository> | <mongodb-uri>}");

        OptionSet options = parser.parse(args);
        List<String> nonOptions = nonOption.values(options);
View Full Code Here

    DownOperationOptions operationOptions = new DownOperationOptions();

    OptionParser parser = new OptionParser();
    parser.allowsUnrecognizedOptions();

    OptionSpec<String> optionConflictStrategy = parser.acceptsAll(asList("C", "conflict-strategy")).withRequiredArg();
    OptionSpec<Void> optionNoApply = parser.acceptsAll(asList("A", "no-apply"));

    OptionSet options = parser.parse(operationArguments);

    // --conflict-strategy=<strategy>
View Full Code Here

    OptionParser parser = new OptionParser();
    parser.allowsUnrecognizedOptions();

    OptionSpec<String> optionConflictStrategy = parser.acceptsAll(asList("C", "conflict-strategy")).withRequiredArg();
    OptionSpec<Void> optionNoApply = parser.acceptsAll(asList("A", "no-apply"));

    OptionSet options = parser.parse(operationArguments);

    // --conflict-strategy=<strategy>
    if (options.has(optionConflictStrategy)) {
View Full Code Here

    RestoreOperationOptions operationOptions = new RestoreOperationOptions();

    OptionParser parser = new OptionParser()
    parser.allowsUnrecognizedOptions();
   
    OptionSpec<Integer> optionRevision = parser.acceptsAll(asList("r", "revision")).withRequiredArg().ofType(Integer.class);
    OptionSpec<String> optionTarget = parser.acceptsAll(asList("t", "target")).withRequiredArg().ofType(String.class);
   
    OptionSet options = parser.parse(operationArgs)
   
    // --revision=<n>
View Full Code Here

    OptionParser parser = new OptionParser()
    parser.allowsUnrecognizedOptions();
   
    OptionSpec<Integer> optionRevision = parser.acceptsAll(asList("r", "revision")).withRequiredArg().ofType(Integer.class);
    OptionSpec<String> optionTarget = parser.acceptsAll(asList("t", "target")).withRequiredArg().ofType(String.class);
   
    OptionSet options = parser.parse(operationArgs)
   
    // --revision=<n>
    if (options.has(optionRevision)) {
View Full Code Here

    StatusOperationOptions operationOptions = new StatusOperationOptions();

    OptionParser parser = new OptionParser()
    parser.allowsUnrecognizedOptions();
   
    OptionSpec<Void> optionForceChecksum = parser.acceptsAll(asList("f", "force-checksum"));
   
    OptionSet options = parser.parse(operationArgs)
   
    // --force-checksum
    operationOptions.setForceChecksum(options.has(optionForceChecksum));
View Full Code Here

  @Override
  public WatchOperationOptions parseOptions(String[] operationArgs) throws Exception {
    WatchOperationOptions operationOptions = new WatchOperationOptions();

    OptionParser parser = new OptionParser()
    OptionSpec<Integer> optionInterval = parser.acceptsAll(asList("i", "interval")).withRequiredArg().ofType(Integer.class);
    OptionSpec<Void> optionNoAnnouncements = parser.acceptsAll(asList("N", "no-announcements"));
    OptionSpec<String> optionAnnouncements = parser.acceptsAll(asList("a", "announce")).withRequiredArg();
    OptionSpec<Void> optionNoWatcher = parser.acceptsAll(asList("W", "no-watcher"));
    OptionSpec<Integer> optionSettleDelay = parser.acceptsAll(asList("s", "delay")).withRequiredArg().ofType(Integer.class);
   
View Full Code Here

  public WatchOperationOptions parseOptions(String[] operationArgs) throws Exception {
    WatchOperationOptions operationOptions = new WatchOperationOptions();

    OptionParser parser = new OptionParser()
    OptionSpec<Integer> optionInterval = parser.acceptsAll(asList("i", "interval")).withRequiredArg().ofType(Integer.class);
    OptionSpec<Void> optionNoAnnouncements = parser.acceptsAll(asList("N", "no-announcements"));
    OptionSpec<String> optionAnnouncements = parser.acceptsAll(asList("a", "announce")).withRequiredArg();
    OptionSpec<Void> optionNoWatcher = parser.acceptsAll(asList("W", "no-watcher"));
    OptionSpec<Integer> optionSettleDelay = parser.acceptsAll(asList("s", "delay")).withRequiredArg().ofType(Integer.class);
   
    OptionSet options = parser.parse(operationArgs)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.