dotnet / dotnet/command-line-api

--version causes error "--version option cannot be combined with other arguments"

Open
#1,304 5 comments 4 reactions 0 assignees View on GitHub
Area-Parser and Binder bug
Dominant language
C#
Stars
3.7k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

Hello!

There seems to be a problem with the "--version" option with DragonFruit (0.3.0-alpha.21216.1). Using the "Building your first app with System.CommandLine.DragonFruit" as an example:

output of the "help" command is:
> [...]
>Options:
> --int-option intOption [default: 42]
> --bool-option boolOption [default: False]
> --file-option fileOption [default: ]
> --str str [default: ]
> --version Show version information
> -?, -h, --help Show help and usage information

typing "ConsoleApp1 --version" yields:
> --version option cannot be combined with other arguments.
>[...]

I would expect it to simply work like the --help menu, but display the version number.

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.