Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.Option;
* Hello world! class that is paramaterized (with defaults) using arg4j.
* Example cli usage: java -jar helloWorldParamaterized --msg='Hello arg4j!'
public class helloWorldParamaterized
private String msg = "Hello World!";
public static void main(String[] args) throws Exception {
new helloWorldParamaterized().doMain(args);
public void doMain(String[] args) throws Exception {
// make a parser
CmdLineParser parser = new CmdLineParser(this);
// parse args
// print message passed in from args
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment