commandlineparser / commandlineparser/commandline
Selecting ONLY ONE OPTION in a Group
- 主要语言
- C#
- 星标
- 4.8k
- 派生
- 478
- PR 合并指标
- 30 天内没有已合并 PR
描述
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
贡献指南
这个仓库没有索引到贡献指南
调研方向
首先跟踪四个 TimeFrameOptions 属性如何处理 Group 设置,并确定它是否支持恰好选择一个选项。完成意味着所请求的行为已得到明确定义,并且四选项示例对于选择一个选项具有经过验证的成功路径,对于未选择任何选项或选择多个选项时具有明确的结果。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp
- 领域
- cli
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100