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
When a command is using an array arguments, Cocona sets all ICommandParameterSet parameters to null. This behavior only occurs when the argument is an array. When the argument is, for example, a string it works fine and the ICommandParameterSet parameters are appropriately initialized.
.net 8 with Cocona 2.2.0
Here is a simple app that demonstrates this issue:
usingCocona;usingSystem;varbuilder=CoconaApp.CreateBuilder(args);varapp=builder.Build();// testParameters will be nullapp.AddCommand("command",(TestParameterstestParameters,[Argument]string[]strs)=>{Console.WriteLine(testParameters.Param);Console.WriteLine(testParameters.Switch);Console.WriteLine(strs);});awaitapp.RunAsync();publicrecordclassTestParameters(boolParam,boolSwitch):ICommandParameterSet;
Command is executed as such to display behavior:
command --param str1 str2
The text was updated successfully, but these errors were encountered:
When a command is using an array arguments, Cocona sets all ICommandParameterSet parameters to null. This behavior only occurs when the argument is an array. When the argument is, for example, a
string
it works fine and the ICommandParameterSet parameters are appropriately initialized..net 8 with Cocona 2.2.0
Here is a simple app that demonstrates this issue:
Command is executed as such to display behavior:
The text was updated successfully, but these errors were encountered: