addEnumOption

Adds an option that will use the lowercased toString() value of an enum constant as option. Calling this method behaves exactly like calling addEnumOption(option, null).

addEnumOption("foo") will not produce any arguments.


enum Foo { BAR }
// ...
addEnumOption("foo").setValue(Foo.BAR)

will produce the command-line

    -bar

Return

an option object to further configure the value

Parameters

option

command-line option identifier


open fun <T : Enum<T>?> addEnumOption(option: String, value: T): JavadocOptionFileOption<T>(source)

Adds an option that will use the lowercased toString() value of an enum constant as option. The option name is only used to further configure the value and will not make it into the argument list.


enum Foo { BAR, BAZ }
// ...
addEnumOption("foo", Foo.BAR)

will produce the command-line

    -bar

A value of null will make the option not be supplied and can be used to unset an option that previously was set.

The returned option object can also be used to further configure the value.

addEnumOption("foo", Foo.BAR).setValue(Foo.BAZ) will produce the command-line

    -baz

Return

an option object to further configure the value

Parameters

option

command-line option identifier

value

the option to supply or null to suppress the option