dotnet / dotnet/command-line-api

Two-column text in option description in --help

Open
#1,883 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
3.7k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

When `--help` describes an option that takes an enum-like argument, how can I format the possible values and their descriptions in two columns?

Like in `DIR /?` of cmd.exe:

```
/T Controls which time field displayed or used for sorting
timefield C Creation
A Last Access
W Last Written
```

or in a private tool that queries [DbProviderFactories.GetFactoryClasses()](https://learn.microsoft.com/dotnet/api/system.data.common.dbproviderfactories.getfactoryclasses?view=netframework-4.8):

```
/Provider:PROVIDER Select the ADO.NET provider.
PROVIDER must be one of:
System.Data.Odbc .Net Framework Data Provider for Odbc
System.Data.OleDb .Net Framework Data Provider for OleDb
System.Data.OracleClient .Net Framework Data Provider for Oracle
System.Data.SqlClient .Net Framework Data Provider for SqlServer
```

Such a feature almost exists for completions, as [CompletionItem](https://learn.microsoft.com/dotnet/api/system.commandline.completions.completionitem) has both `InsertText` and `Documentation` properties, but HelpBuilder.Default.GetArgumentUsageLabel currently uses CompletionItem.Label only:

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.