# addEnumOption

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

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)

Content copied to clipboard

will produce the command-line

        -bar

Content copied to clipboard

#### Return

an option object to further configure the value

#### Since

0.7

#### 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)

Content copied to clipboard

will produce the command-line

        -bar

Content copied to clipboard

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

Content copied to clipboard

#### Return

an option object to further configure the value

#### Since

0.7

#### Parameters

option

command-line option identifier

value

the option to supply or `null` to suppress the option