args4j

Usage examples

  • Required single argument,

    @Option(name="-name",usage="Sets a name")
    public String name;
  • Comma seperated arguments,

    @Option(name = "--files", required = true, handler = CSVStringOptionHandler.class)
    private List<String> files;
  • Boolean or flag arguments,

    @Option(name = "--dryrun", handler = ExplicitBooleanOptionHandler.class)
    private boolean dryRun;

Last updated