dotnet / dotnet/command-line-api
Usage section shows Argument.Name rather than Argument.HelpName
- 主要言語
- C#
- スター
- 3.7k
- フォーク
- 428
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
In the help output, the Usage section shows Argument.Name, but the Arguments section shows Argument.HelpName. I think this is inconsistent and they should both use Argument.HelpName if set, so that Argument.Name would be culture-invariant and usable for System.CommandLine.NamingConventionBinder.
## Demo
```XML
Exe
net7.0
enable
enable
```
```
using System.CommandLine;
using System.IO;
var command = new RootCommand()
{
new Argument(name: "inputfile")
{
HelpName = "inputfile.log",
},
};
return await command.InvokeAsync(args);
```
```
$ dotnet run
Required argument missing for command: 'ArgumentHelpDemo'.
Description:
Usage:
ArgumentHelpDemo [options]
Arguments:
Options:
--version Show version information
-?, -h, --help Show help and usage information
```
## Current implementation
Usage section:
Arguments section:
コントリビューションガイド
調査の方向性
src/System.CommandLine/Help/HelpBuilder.cs の296-304行目から始め、Usage の実装と、Arguments セクションをレンダリングする src/System.CommandLine/Help/HelpBuilder.Default.cs の73-87行目を比較します。提供されているデモを使用して、一貫性のないヘルプ出力を再現します。Usage セクションに設定されている場合は Argument.HelpName が表示され、Arguments セクションと一致しつつ、binding のために Argument.Name が保持されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- csharp
- 領域
- cli
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 45/100