Esempio n. 1
0
 public void test_SameFirstChar() throws Exception {
   CommandLine getopt = new CommandLine(rp);
   CommandTwoOptions c = new CommandTwoOptions();
   getopt.execute(c, "commandTwoOptions", new ExtList<String>("-t", "test", "-T", "title"));
   assertEquals("title", c.title);
   assertEquals("test", c.test);
 }
Esempio n. 2
0
 public void test_SameFirstChar_MaxTwoOptionsWithSameShortcut() throws Exception {
   CommandLine getopt = new CommandLine(rp);
   CommandThreeOptions c = new CommandThreeOptions();
   try {
     getopt.execute(c, "commandThreeOptions", new ExtList<String>());
     fail();
   } catch (Error e) {
   }
 }
Esempio n. 3
0
 public void test_SameFirstChar_NoCapitalizedCommands() throws Exception {
   CommandLine getopt = new CommandLine(rp);
   CommandWrongOption c = new CommandWrongOption();
   try {
     getopt.execute(c, "commandWrongOption", new ExtList<String>());
     fail();
   } catch (Error e) {
   }
 }
Esempio n. 4
0
 public void testSimple() throws Exception {
   CommandLine getopt = new CommandLine(rp);
   C1 c1 = new C1();
   String help =
       getopt.execute(
           c1,
           "c1",
           new ExtList<String>(
               "-f", "-a", "33", "--bb", "bb", "-i", "f1.txt", "-i", "f2.txt", "--", "-a", "--a",
               "a"));
   System.err.println(help);
 }
Esempio n. 5
0
 public void testHelp() throws Exception {
   CommandLine getopt = new CommandLine(rp);
   C1 c1 = new C1();
   getopt.execute(c1, "help", new ExtList<String>("c1"));
 }
Esempio n. 6
0
  public void testCommand() throws Exception {
    CommandLine getopt = new CommandLine(rp);
    assertEquals("[cmda, cmdb]", getopt.getCommands(new X()).keySet().toString());

    getopt.execute(new X(), "cmda", Arrays.asList("-e", "help"));
  }