Examples of allowsUnrecognizedOptions()


Examples of joptsimple.OptionParser.allowsUnrecognizedOptions()

public class Main {
  public static void main(String[] par0ArrayOfStr) {
    System.setProperty("java.net.preferIPv4Stack", "true");
    OptionParser var1 = new OptionParser();
    var1.allowsUnrecognizedOptions();
    var1.accepts("demo");
    var1.accepts("fullscreen");
    ArgumentAcceptingOptionSpec var2 = var1.accepts("server").withRequiredArg();
    ArgumentAcceptingOptionSpec var3 = var1.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(25565), new Integer[0]);
    ArgumentAcceptingOptionSpec var4 = var1.accepts("gameDir").withRequiredArg().ofType(File.class).defaultsTo(new File("."), new File[0]);
View Full Code Here

Examples of joptsimple.OptionParser.allowsUnrecognizedOptions()

public class UnrecognizedOptionsAllowedTest {
    @Test
    public void acceptsLongOptions() {
        OptionParser parser = new OptionParser();
        parser.allowsUnrecognizedOptions();
        parser.accepts( "f" );

        OptionSet options = parser.parse( "-f", "-d" );

        assertTrue( options.has( "f" ) );
View Full Code Here

Examples of joptsimple.OptionParser.allowsUnrecognizedOptions()

  public DownOperationOptions parseOptions(String[] operationArguments) {
    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);
View Full Code Here

Examples of joptsimple.OptionParser.allowsUnrecognizedOptions()

  @Override
  public RestoreOperationOptions parseOptions(String[] operationArgs) throws Exception {
    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)
View Full Code Here

Examples of joptsimple.OptionParser.allowsUnrecognizedOptions()

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

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

Examples of joptsimple.OptionParser.allowsUnrecognizedOptions()

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

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

    OptionSpec<Void> optionForceUpload = parser.acceptsAll(asList("F", "force-upload"));

    OptionSet options = parser.parse(operationArgs);
View Full Code Here

Examples of joptsimple.OptionParser.allowsUnrecognizedOptions()

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

    OptionParser parser = new OptionParser();
    parser.allowsUnrecognizedOptions();
   
    OptionSpec<String> optionDateStr = parser.acceptsAll(asList("D", "date")).withRequiredArg();
    OptionSpec<Void> optionRecursive = parser.acceptsAll(asList("r", "recursive"));
    OptionSpec<String> optionFileTypes = parser.acceptsAll(asList("t", "types")).withRequiredArg();
    OptionSpec<Void> optionLongChecksums = parser.acceptsAll(asList("f", "full-checksums"));
View Full Code Here

Examples of joptsimple.OptionParser.allowsUnrecognizedOptions()

   
    OptionParser parser = new OptionParser();
    OptionSpec<Void> optionMachineReadable = parser.acceptsAll(asList("m", "machine-readable"));   
    OptionSpec<Void> optionShort = parser.acceptsAll(asList("s", "short"));   

    parser.allowsUnrecognizedOptions();   
    OptionSet options = parser.parse(operationArgs);

    // --machine-readable, -m
    machineReadableOutput = options.has(optionMachineReadable);
   
View Full Code Here

Examples of joptsimple.OptionParser.allowsUnrecognizedOptions()

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

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

    OptionSpec<Void> optionForce = parser.acceptsAll(asList("f", "force"));
    OptionSpec<Void> optionNoDatabaseMerge = parser.acceptsAll(asList("M", "no-database-merge"));
    OptionSpec<Void> optionNoOldVersionRemoval = parser.acceptsAll(asList("V", "no-version-removal"));
    OptionSpec<Void> optionNoRemoveTempFiles = parser.acceptsAll(asList("T", "no-temp-removal"));
View Full Code Here

Examples of joptsimple.OptionParser.allowsUnrecognizedOptions()

    // WARNING: Do not re-order methods unless you know what you are doing!

    try {
      // Define global options
      OptionParser parser = new OptionParser();
      parser.allowsUnrecognizedOptions();

      OptionSpec<Void> optionHelp = parser.acceptsAll(asList("h", "help"));
      OptionSpec<File> optionLocalDir = parser.acceptsAll(asList("l", "localdir")).withRequiredArg().ofType(File.class);
      OptionSpec<String> optionLog = parser.acceptsAll(asList("log")).withRequiredArg();
      OptionSpec<Void> optionLogPrint = parser.acceptsAll(asList("print"));
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.