dotnet / dotnet/command-line-api

Usage section shows Argument.Name rather than Argument.HelpName

Abierto
#2,004 1 comentario 0 reacciones 0 asignados Ver en GitHub
Area-Help bug
Lenguaje dominante
C#
Estrellas
3.7k
Forks
428
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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:

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comience en src/System.CommandLine/Help/HelpBuilder.cs, en las líneas 296-304, y compare la implementación de Usage con src/System.CommandLine/Help/HelpBuilder.Default.cs, en las líneas 73-87, que renderiza la sección Arguments. Use la demo proporcionada para reproducir la salida de ayuda incoherente. Se considera terminado cuando la sección Usage muestra Argument.HelpName cuando está establecido, coincidiendo con la sección Arguments y conservando Argument.Name para el binding.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
csharp
Área
cli
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.