You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error message "--version option cannot be combined with other arguments." is not displayed when "--help" is also specified on the command line.
Steps to reproduce:
Build console app with Program.cs:
internal class Program
{
static async Task<int> Main(string[] args)
{
RootCommand rootCommand = new RootCommand();
var option = new Option<bool>("--option1");
rootCommand.Add(option);
rootCommand.Handler = CommandHandler.Create(() =>
{
Console.WriteLine("Hello, World!");
});
return await rootCommand.InvokeAsync(args);
}
}
Run ConsoleApp1.exe --option1 --version
Notice the error --version option cannot be combined with other arguments.
This is expected behavior.
Run ConsoleApp10.exe --help --version
Notice the error is not displayed.
Only the version is displayed.
This is unexpected behavior; I expected the error --version option cannot be combined with other arguments..
Run ConsoleApp10.exe --option1 --help --version
Notice the error is not displayed.
Only the version is displayed.
This is unexpected behavior; I expected the error --version option cannot be combined with other arguments..
System.CommandLine 2.0.0-beta4.22272.1
Thank you.
The text was updated successfully, but these errors were encountered:
Hi.
Thank you for System.CommandLine.
The error message "--version option cannot be combined with other arguments." is not displayed when "--help" is also specified on the command line.
Steps to reproduce:
Run
ConsoleApp1.exe --option1 --version
Notice the error
--version option cannot be combined with other arguments.
This is expected behavior.
Run
ConsoleApp10.exe --help --version
Notice the error is not displayed.
Only the version is displayed.
This is unexpected behavior; I expected the error
--version option cannot be combined with other arguments.
.Run
ConsoleApp10.exe --option1 --help --version
Notice the error is not displayed.
Only the version is displayed.
This is unexpected behavior; I expected the error
--version option cannot be combined with other arguments.
.System.CommandLine 2.0.0-beta4.22272.1
Thank you.
The text was updated successfully, but these errors were encountered: