JewelCli accessor method names

JewelCli 0.8.2 and above supports query methods with or without the “get” prefix:

public interface MyExample
{
  @Option
  String getMyOption();
 
  @Option
  String myOtherOption();
}

The instance strategy now supports mutators with or without the “set” prefix:

public class MyExample
{
  @Option
  void setMyOption(String value) {}
 
  @Option
  void myOtherOption(String value) {}
}

JewelCli Constrained Multivalued Option

A new feature in JewelCli 0.8.1 is the ability to constrain the multiplicity of multivalued options. If the arguments given by the user do not match the constraints an appropriate ArgumentValidationException is thrown.

Minimum

public interface ListWithMinimumOfOne {
    @Option(minimum = 1) List<String> getMyOption();
}

Maximum

public interface ListWithMaximumOfFour {
    @Option(maximum = 4) List<String> getMyOption();
}

Exact Count

public interface ListWithExactlyThree {
    @Option(exactly = 3) List<String> getMyOption();
}

JewelCli Hidden Options

As of version 0.8.1 JewelCli supports hidden options. These are options that will not show up in your help message.

interface HiddenOptionNotIncludedInHelp
{
     @Option(hidden = true)
     boolean getDebug();
}

Will create an option called “–debug” which you can specify on the command line, but will not be advertised in any help messages.