Home | History | Annotate | only in /external/jcommander
Up to higher level directory
NameDateSize
.gitignore24-Aug-201691
Android.mk24-Aug-20161.7K
build-with-maven24-Aug-2016750
CHANGELOG24-Aug-20165.1K
doc/24-Aug-2016
license.txt24-Aug-201611.1K
MODULE_LICENSE_APACHE224-Aug-20160
NOTICE24-Aug-201611.1K
notice.md24-Aug-2016108
pom.xml24-Aug-20168.8K
README.markdown24-Aug-20161.3K
README.version24-Aug-2016131
release24-Aug-2016292
src/24-Aug-2016
upload24-Aug-2016192

README.markdown

      1 JCommander
      2 ==========
      3 
      4 This is an annotation based parameter parsing framework for Java.
      5 
      6 Here is a quick example:
      7 
      8 ```java
      9 public class JCommanderTest {
     10     @Parameter
     11     public List<String> parameters = Lists.newArrayList();
     12  
     13     @Parameter(names = { "-log", "-verbose" }, description = "Level of verbosity")
     14     public Integer verbose = 1;
     15  
     16     @Parameter(names = "-groups", description = "Comma-separated list of group names to be run")
     17     public String groups;
     18  
     19     @Parameter(names = "-debug", description = "Debug mode")
     20     public boolean debug = false;
     21 
     22     @DynamicParameter(names = "-D", description = "Dynamic parameters go here")
     23     public Map<String, String> dynamicParams = new HashMap<String, String>();
     24 
     25 }
     26 ```
     27 
     28 and how you use it:
     29 
     30 ```java
     31 JCommanderTest jct = new JCommanderTest();
     32 String[] argv = { "-log", "2", "-groups", "unit1,unit2,unit3",
     33                     "-debug", "-Doption=value", "a", "b", "c" };
     34 new JCommander(jct, argv);
     35 
     36 Assert.assertEquals(2, jct.verbose.intValue());
     37 Assert.assertEquals("unit1,unit2,unit3", jct.groups);
     38 Assert.assertEquals(true, jct.debug);
     39 Assert.assertEquals("value", jct.dynamicParams.get("option"));
     40 Assert.assertEquals(Arrays.asList("a", "b", "c"), jct.parameters);
     41 ```
     42 
     43 The full doc is available at http://beust.com/jcommander
     44 

README.version

      1 URL: https://github.com/cbeust/jcommander
      2 Version: 1.48 (14fbe2bc5a2c402b456ed68578a5d5dc2c343fa2)
      3 BugComponent: 99142
      4 Owners: iam
      5