Skip to content

Mode flags

H90 edited this page May 7, 2021 · 6 revisions

An @Option of type boolean is interpreted as a mode flag. The boolean indicates whether the flag was present on the command line.

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

The type must be boolean exactly. Boolean or Optional<Boolean> will not work.

Clone this wiki locally