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
using McMaster.Extensions.CommandLineUtils;[Command("console-app")][Subcommand(typeof(ConfigureCommand))]publicclassProgram{staticvoidMain(string[]args)=> CommandLineApplication.Execute<Program>(args);publicintOnExecute()=>1;}[Command][Subcommand(typeof(ListCommand))]publicclassConfigureCommand{[Argument(0)]publicstring?ArgumentProperty{get;set;}publicintOnExecute(){ Console.WriteLine($"configure: {ArgumentProperty}");return0;}}[Command]publicclassListCommand{[Argument(0)]publicstring?ArgumentProperty{get;set;}publicintOnExecute(){ Console.WriteLine($"list: {ArgumentProperty}");return0;}}
Run the console application with the arguments configure list any-value
Additional context
There is a work around for this bug, but only if it's possible to define a base class that contains the argument property for both commands: configure and list.
Describe the bug
Defining a property as Argument in a command and also in one of its sub commands, it generates an exception.
To Reproduce
Steps to reproduce the behavior:
configure list any-value
Additional context
There is a work around for this bug, but only if it's possible to define a base class that contains the argument property for both commands:
configure
andlist
.The text was updated successfully, but these errors were encountered: