dotnet / dotnet/command-line-api

Flag to hide description

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

Description

Hi,

It would be helpful to have a flag or property to control whether the **description** is included in the generated HelpText output.

In our use case, we are using the HelpText in our documentation, and we don’t want to include the description section—especially when the description is empty.

Here’s a minimal example:

```csharp
RootCommand rootCommand = new RootCommand();
CommandLineConfiguration config = new(rootCommand) {Output = new StringWriter()};
config.Invoke("--help");
Console.Out.WriteLine(config.Output);
```

**Current Output:**
```
Description:

Usage:
ConsoleApp1 [options]

Options:
-?, -h, --help Show help and usage information
--version Show version information
```

It would be great to have a way to suppress the `Description:` section entirely, for example:

```csharp
rootCommand.HideDescription = true;
```

Thanks for the great library!

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.