dotnet / dotnet/command-line-api
Usage section shows Argument.Name rather than Argument.HelpName
- Dominant language
- C#
- Stars
- 3.7k
- Forks
- 428
- PR merge metrics
- No merged PRs in 30d
Description
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:
Contributor guide
Assessment
This issue has not been assessed yet.