commandlineparser / commandlineparser/commandline

Showing help with no arguments when you have a default verb

オープン
#748 コメント 0 件 リアクション 0 件 担当者 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" };
}
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。