commandlineparser / commandlineparser/commandline
Support + (plus) sign for flags to UNSET a flag often used by Linux
- 主要语言
- C#
- 星标
- 4.8k
- 派生
- 478
- PR 合并指标
- 30 天内没有已合并 PR
描述
>All of the single letter options that have a corresponding name can be used as an argument to the -o option. The set -o name is provided next to the single letter option in the description below. Specifying a dash “-” turns the option on, while using a plus “+” disables the option.
Meaning, assume you have the following option:
[Option('x', "XXXX", Required = false, Default = true)]
public bool X { get; set; }
And you would pass `+x`, then the result should be `False`:
app.exe +x
This seems like a better approach then a nullable bool:
[Option('x', "XXXX", Required = false, Default = true)]
public bool? X { get; set; }
As that requires to pass:
app.exe -x false
贡献指南
这个仓库没有索引到贡献指南
调研方向
在命令行选项解析入口中查找现有的单字母 flag 处理,以及涵盖选项前缀的测试。验证声明为默认值 true 的选项在以 +x 调用时会变为 false,同时保留文档所述的 -x 行为;为所请求的语法添加覆盖测试。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp
- 领域
- cli
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100