Skip to content

Support for tri-state flags with [CommandFlag] #204

@adambajguz

Description

@adambajguz

There are other CLI tools that include both options, e.g. --restore and --no-restore, where you are giving three possible values to the user: true (associated with Name), false (NoName) and default.

[CommandFlag(Name="flag", NoName = "no-flag")]
public bool? Flag{  get; init; } //bool? or custom struct Flag

Some problems:

  • what about current bool flags?
  • what about short flags: -abc
  • what if the dafuatl is not null but true or false?

Metadata

Metadata

Assignees

No one assigned

    Labels

    TypinTypin library related issuesconceptHelp and further investigation on the proposal is needed.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions