Skip to content

flag: add BoolFunc(name, usage string, fn func(string)error) #53747

@fnxpt

Description

@fnxpt

Using flag.Func forces you to always pass an argument. Sometimes we don't really need an argument and its really convenient to be able to just call this flags without passing any dummy value.

Example:
Setting the flag --start-server will ask you to specify a value and also mentions it on the usage
-start-server value
Starts the server

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions