commandlineparser / commandlineparser/commandline

Selecting ONLY ONE OPTION in a Group

Đang mở
#707 0 bình luận 3 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C#
Star
4.8k
Fork
478
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

From my understanding, in a group there needs to be atleast one or more than one option specified. In my use case, for the class given below, I want to select **only ONE option (not more)**. Is there any way to do this?

```csharp
internal class TimeFrameOptions
{
[Option(shortName: 's', longName: "seconds", Group = "timeframe", HelpText = "")]
public int Seconds { get; set; }

[Option(shortName: 'm', longName: "minutes", Group = "timeframe", HelpText = "")]
public int Minutes { get; set; }

[Option(shortName: 'h', longName: "hours", Group = "timeframe", HelpText = "")]
public int Hours { get; set; }

[Option(shortName: 'd', longName: "days", Group = "timeframe", HelpText = "")]
public int Days { get; set; }
}
```
Thanks

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.