Package com.beust.jcommander

Examples of com.beust.jcommander.JCommander.addObject()


  @Parameter(names={"-h", "-?", "--help", "-help"}, help=true)
  public boolean help = false;
 
  public void parseArgs(String programName, String[] args, Object ... others) {
    JCommander commander = new JCommander();
    commander.addObject(this);
    for (Object other : others)
      commander.addObject(other);
    commander.setProgramName(programName);
    try {
      commander.parse(args);
View Full Code Here


 
  public void parseArgs(String programName, String[] args, Object ... others) {
    JCommander commander = new JCommander();
    commander.addObject(this);
    for (Object other : others)
      commander.addObject(other);
    commander.setProgramName(programName);
    try {
      commander.parse(args);
    } catch (ParameterException ex) {
      commander.usage();
View Full Code Here

  @Parameter(names={"-h", "-?", "--help", "-help"}, help=true)
  public boolean help = false;
 
  public void parseArgs(String programName, String[] args, Object ... others) {
    JCommander commander = new JCommander();
    commander.addObject(this);
    for (Object other : others)
      commander.addObject(other);
    commander.setProgramName(programName);
    try {
      commander.parse(args);
View Full Code Here

 
  public void parseArgs(String programName, String[] args, Object ... others) {
    JCommander commander = new JCommander();
    commander.addObject(this);
    for (Object other : others)
      commander.addObject(other);
    commander.setProgramName(programName);
    try {
      commander.parse(args);
    } catch (ParameterException ex) {
      commander.usage();
View Full Code Here

    assertEquals(Constants.NO_AUTHS, args.auths);
    assertEquals("localhost:2181", args.zookeepers);
    assertFalse(args.help);
   
    JCommander jc = new JCommander();
    jc.addObject(args);
    jc.addObject(bwOpts);
    jc.addObject(bsOpts);
    jc.parse("-u", "bar", "-p", "foo", "--batchLatency", "3s", "--batchTimeout", "2s", "--batchMemory", "1M", "--debug", "--trace", "--scanThreads", "7", "-i",
        "instance", "--auths", "G1,G2,G3", "-z", "zoohost1,zoohost2", "--help");
    assertEquals("bar", args.principal);
View Full Code Here

    assertEquals("localhost:2181", args.zookeepers);
    assertFalse(args.help);
   
    JCommander jc = new JCommander();
    jc.addObject(args);
    jc.addObject(bwOpts);
    jc.addObject(bsOpts);
    jc.parse("-u", "bar", "-p", "foo", "--batchLatency", "3s", "--batchTimeout", "2s", "--batchMemory", "1M", "--debug", "--trace", "--scanThreads", "7", "-i",
        "instance", "--auths", "G1,G2,G3", "-z", "zoohost1,zoohost2", "--help");
    assertEquals("bar", args.principal);
    assertNull(args.securePassword);
View Full Code Here

    assertFalse(args.help);
   
    JCommander jc = new JCommander();
    jc.addObject(args);
    jc.addObject(bwOpts);
    jc.addObject(bsOpts);
    jc.parse("-u", "bar", "-p", "foo", "--batchLatency", "3s", "--batchTimeout", "2s", "--batchMemory", "1M", "--debug", "--trace", "--scanThreads", "7", "-i",
        "instance", "--auths", "G1,G2,G3", "-z", "zoohost1,zoohost2", "--help");
    assertEquals("bar", args.principal);
    assertNull(args.securePassword);
    assertEquals(new PasswordToken("foo"), args.getToken());
View Full Code Here

  }

  @VisibleForTesting
  public void parseArgs(String... args) {
    JCommander jcommander = new JCommander();
    jcommander.addObject(options);

    try {
      jcommander.parse(args);
    } catch (ParameterException e) {
      jcommander.usage();
View Full Code Here

  public boolean config(String... args) {
    ShellOptionsJC options = new ShellOptionsJC();
    JCommander jc = new JCommander();

    jc.setProgramName("accumulo shell");
    jc.addObject(options);
    try {
      jc.parse(args);
    } catch (ParameterException e) {
      configError = true;
    }
View Full Code Here

    assertEquals(Authorizations.EMPTY, args.auths);
    assertEquals("localhost:2181", args.zookeepers);
    assertFalse(args.help);

    JCommander jc = new JCommander();
    jc.addObject(args);
    jc.addObject(bwOpts);
    jc.addObject(bsOpts);
    jc.parse("-u", "bar", "-p", "foo", "--batchLatency", "3s", "--batchTimeout", "2s", "--batchMemory", "1M", "--debug", "--trace", "--scanThreads", "7", "-i",
        "instance", "--auths", "G1,G2,G3", "-z", "zoohost1,zoohost2", "--help");
    assertEquals("bar", args.principal);
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.