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
Describe the bug
--version option is working for the root command as expected.
However, when I run --version option for any subcommands, it does not print version and --version option is ignored.
mycommand --version
1.0.0
mycommand subcommand --version
... runs the subcommand without printing out the version
This is confusing because --help option displays --version as a valid option for all subcommands by default.
mycommand subcommand --help
USAGE:
mycommand subcommand [OPTIONS]
OPTIONS:
DEFAULT
-h, --help Prints help information
-v, --version Prints version information
-o, --output test My custom option
To Reproduce
Run any spectre subcommands with --version.
Expected behavior
--version MUST NOT be displayed by default as part of --help output for subcommands that do not have explicitly defined --version option.
Please upvote 👍 this issue if you are interested in it.
The text was updated successfully, but these errors were encountered:
I feel like I have a similar issue when using a "default command".
Main file
moduleCommitLinter.MainopenSpectre.Console.CliopenCommitLinter.Commands[<EntryPoint>]letmain args =letapp= CommandApp<GenerateCommand>()
app
.WithDescription("Generate changelog based on the Git history.")
.Configure(fun config ->
config.Settings.ApplicationName <-"changelog-gen"// Find a name)
app.Run(args)
Command file
namespaceCommitLinter.CommandsopenSpectre.ConsoleopenSpectre.Console.CliopenSystem.ComponentModelopenSystem.IOtypeGenerateSettings()=inherit CommandSettings()[<CommandOption("-c|--config")>][<Description("Path to the configuration file")>]member valConfig:string option = None with get, set
typeGenerateCommand()=inherit Command<GenerateSettings>()interface ICommandLimiter<GenerateSettings>override__.Execute(context,settings)=
printfn "Generate command"0
Then if I run dotnet run --project myProject.fsproj -- --version it will prints Generate command when I expect it to print the version number of the tool.
Use strict parsing doesn't help, it only report an issue because --version is unknown probably because it is using the options config from the Generate command only ?
Information
Describe the bug
--version option is working for the root command as expected.
However, when I run --version option for any subcommands, it does not print version and --version option is ignored.
This is confusing because --help option displays --version as a valid option for all subcommands by default.
To Reproduce
Run any spectre subcommands with --version.
Expected behavior
--version MUST NOT be displayed by default as part of --help output for subcommands that do not have explicitly defined --version option.
Please upvote 👍 this issue if you are interested in it.
The text was updated successfully, but these errors were encountered: