Home - fedups/com.obdobion.argument GitHub Wiki

"Argument" is a full featured command line argument processor for Java. Essentially, it allows your program to get run-time direction from the user as they execute it on the command line. Everything that Argument can do for your application is done through Java Annotations on variables.

It is as simple as the following to display a message on the console.

public class MyTest {
  @Arg
  String message;
 
  public static void main (String... args) {
     CmdLine.load(this, args);
     System.out.println(message);
  }
}

Then the user would enter this on the command line.

> ... MyTest --message "Hello World"

The ... is there because you have so many options of packaging and executing this sample program. I would just run this within Eclipse and not package it up at all.

This just barely touches on the features in Argument. Take a look at the Basics first. The side menu gives you the entry points into the rest of the documentation.