commandlineparser / commandlineparser/commandline

Showing help with no arguments when you have a default verb

未關閉
#748 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
C#
星號
4.8k
分支
478
PR 合併指標
30 天內沒有已合併 PR

描述

I want to show the verbs help when you provide no arguments:

`tool` --> Shows verbs help.
`tool arg1 arg2` --> Executes default verb with those args.

By default, it either executes the default verb without arguments or, if this verb has required values, it shows the error and help for that verb.

My current workaround is this one, but I wonder if there is a neater way:

```csharp
if (args.Length == 0)
{
args = new[] { "--help" };
}
```

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

首先追蹤 parser 如何處理零個引數並選擇預設 verb,然後重現 issue 中的兩個命令範例。完成的標準是:不帶引數時顯示 verb 的說明,而附加引數仍會使用這些引數執行預設 verb。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
csharp
領域
cli
Issue 類型
功能
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

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

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