dotnet / dotnet/command-line-api

Option constraint to accept only positive integers?

Open
#940 14 comments 0 reactions 0 assignees View on GitHub
Area-Parser and Binder enhancement
Dominant language
C#
Stars
3.7k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

Hi,
First, thanks a lot for all the effort on this library!

Am I correct to assume that currently System.CommandLine does not support constraints on integer options? Is there a convention how to implement such constraints?

I looked int `Option{T}.cs` and `OptionExtensions.cs`, but I only see constraints related to strings, files and directories.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.