dotnet / dotnet/command-line-api
Missed options in help section
- Dominant language
- C#
- Stars
- 3.7k
- Forks
- 428
- PR merge metrics
- No merged PRs in 30d
Description
Missed options in help section when calling with `-h` argument
Way to reproduce:
```C#
private static async Task Main(string[] args)
{
var rootCommand = new RootCommand("Migration tool for SQL Database")
{
new Option(new[] { "--source-connection-string", "-scs" }, "Full connection string to source of database.") { IsRequired = true },
new Option(new[] { "--destination-connection-string", "-dcs" }, "Full connection string to source sql server, may contain master database name.") { IsRequired = true },
new Option(new[] { "--created-database-connection-string", "-cdcs" }, "Full connection string to destination database with specified name.") { IsRequired = true },
new Option(new[] { "--database-name", "-dn" }, "Name of destination database") { IsRequired = true },
};
var helpBuilder = (HelpBuilder)default;
rootCommand.TreatUnmatchedTokensAsErrors = true;
rootCommand.Handler = CommandHandler.Create(Migrate);
var commandLineBuilder = new CommandLineBuilder(rootCommand)
.UseTypoCorrections()
.UseParseErrorReporting()
.CancelOnProcessTermination()
.UseExceptionHandler()
.UseHelpBuilder(c =>
{
helpBuilder = new CustomHelpBuilder(c.Console);
return helpBuilder;
})
.Build();
await commandLineBuilder.InvokeAsync(args);
}
```
And then call executable with -h argument
Result of call

When calling without any arguments

So how to display all options, when calling with `-h` or `--help` or `-?`
Contributor guide
Assessment
This issue has not been assessed yet.