commandlineparser / commandlineparser/commandline

Support + (plus) sign for flags to UNSET a flag often used by Linux

未關閉
#833 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
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

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。