GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jhulick/jcommander: Command line parsing framework for Java

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

271 Commits
271 Commits

Folders and files

NameName
Last commit message
Last commit date
doc
doc
 
 
src
src
 
 
.gitignore
.gitignore
 
 
CHANGELOG
CHANGELOG
 
 
README.markdown
README.markdown
 
 
build-with-maven
build-with-maven
 
 
license.txt
license.txt
 
 
notice.md
notice.md
 
 
pom.xml
pom.xml
 
 
release
release
 
 
upload
upload
 
 

Repository files navigation

JCommander

This is an annotation based parameter parsing framework for Java.

Here is a quick example:

public class JCommanderTest {
  @Parameter
  public List<String> parameters = Lists.newArrayList();

  @Parameter(names = { "-log", "-verbose" }, description = "Level of verbosity")
  public Integer verbose = 1;

  @Parameter(names = "-groups", description = "Comma-separated list of group names to be run")
  public String groups;

  @Parameter(names = "-debug", description = "Debug mode")
  public boolean debug = false;
}

and how you use it:

JCommanderTest jct = new JCommanderTest();
String[] argv = { "-log", "2", "-groups", "unit", "a", "b", "c" };
new JCommander(jct, argv);

Assert.assertEquals(jct.verbose.intValue(), 2);

The full doc is available at http://beust.com/jcommander

About

Command line parsing framework for Java

Resources

Readme
Apache-2.0 license
Activity

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.