dotnet / dotnet/command-line-api

Calling --help on a subcommand does not work

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

Description

Using the [tutorial](https://learn.microsoft.com/en-us/dotnet/standard/commandline/get-started-tutorial#add-a-subcommand-and-options) as an example: calling the app with `read --help` throws a stack overflow exception.

It looks like it's calling validation on arguments regardless of whether help was invoked or not when `DefaultValueFactory` is set.

Package version: `System.CommandLine@2.0.0-rc.2.25502.107`

This is close to #2707 (which probably shouldn't be closed), but there is no similar recourse in this situation that I can tell. One is not using class configuration, nor is overriding help or version options.

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.