Skip to content

Required CliOption #2

Closed
Closed
@lookbusy1344

Description

@lookbusy1344

Love the library! If I have a property like:

[CliOption(Description = "Description for Display", AllowedValues = new[] { "Big", "Small" }, Required = true)]
public string? Display { get; set; }

It correctly gives an error for:

prog.exe --display
prog.exe --display invalid

But it runs without error if the option is entirely missing:

prog.exe

Leaving the Display property as null.
Is this correct behaviour? And if so, how do I make the --display option mandatory?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions