Skip to content

Support negatable ("no-") versions of boolean options #694

@adamsmd

Description

@adamsmd

Some Unix commands support "--option" to turn a boolean option on and "--no-option" to turn it off. I would like a convenient way to specify these types of options.

One possible syntax for this would work like the following:

@Option(names={"--foo", "-f"}, inverses={"--no-foo", "+f"})
boolean foo = readDefaultFromEnvironment("FOO");

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions