Skip to content

Mode flags

h908714124 edited this page Aug 13, 2026 · 7 revisions

An @Option of type boolean is interpreted as a mode flag, a.k.a nullary option. The boolean value false represents an absent mode flag on the command line.

@Option(names = { "-n", "--dry-run" })
abstract boolean dryRun();

The method must return the primitive type boolean. Boolean or List<Boolean> will not work.

There is currently no way to define a "repeatable mode flag".

Clone this wiki locally