Skip to content

Enum with flags that can be combined #582

Closed
@dfhwze

Description

@dfhwze

Is it possible to have flagged enum options?

For instance, I would like to be able to combine which categories I would like to log in my tool.

command-line:

mytool -l Admin -l Status

enum used in options:

[Flags]
public enum Logging: uint
{
None = 0,
Admin = 1 << 0,
Status = 1 << 1,
Progress = 1 << 2,
All = 0xFFFFFFFF,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions