dotnet / dotnet/command-line-api
Document how to make Options required
Open
Area-Documentation
- Dominant language
- C#
- Stars
- 3.7k
- Forks
- 428
- PR merge metrics
- No merged PRs in 30d
Description
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("--aws-key", "AWS API Key") { IsRequired = true },
```
Contributor guide
Assessment
This issue has not been assessed yet.