Skip to content

Documentation error in Validation sample program #521

@AGDownie

Description

@AGDownie

Documentation error only.

Affected sample program:
https://github.com/natemcmaster/CommandLineUtils/blob/main/docs/samples/validation/builder-api/Program.cs

These lines in this example program:

29   var importance = app.Option("-i|--importance <IMPORTANCE>", "Low, medium or high", CommandOptionType.SingleValue)
30              .Accepts().Values("low", "medium", "high");

should read:

29   var importance = app.Option("-i|--importance <IMPORTANCE>", "Low, medium or high", CommandOptionType.SingleValue)
30              .Accepts(v => v.Values("low", "medium", "high"));

As it stands the variable importance is of type IValidationBuilder? rather than the expected CommandOption?.

It would also be helpful to show this command option being used in the OnExecute() method.

To Reproduce
N/A

Expected behavior
N/A

Screenshots
N/A

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclosed-staleThis issue is closed because it went stale and there was no action planned. It can be reopened.stale

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions