commandlineparser / commandlineparser/commandline

Issue with boolean switch after verb

未关闭
#778 5 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C#
星标
4.8k
派生
478
PR 合并指标
30 天内没有已合并 PR

描述

**Issue**
When using a boolean switch after a verb, I cannot set it to false

**Example:**
app.exe install --feature=false

**Options class**

```
[Verb("install", HelpText = "Install something")]
class Options
{
[Option('f', "feature", Required = false, Default = true, HelpText = "Enable a feature")]
public bool EnableFeature { get; set; }
}
```

**Expected:**
Feature = False

**Actual result:**
Feature = True

**Demo code:**
[https://dotnetfiddle.net/lSBqxp](https://dotnetfiddle.net/lSBqxp)

**Edit1**
Add Options class code

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。