Skip to content

Document how to make Options required #1075

Open
@oliverjanik

Description

@oliverjanik

I read through the docs and couldn't find how to make options required.
After playing around with the API I found the IsRequired property, Can this be documented in the Wiki?

Also would it be worth adding isRequired to an Option constructor for easier discovery? It seems to me it's might be a very common use-case to have certain flags required.

At the moment the best way of specifying required I found looks like this:

    new Option<string>("--aws-key", "AWS API Key") { IsRequired = true },

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions