Cocona
Cocona copied to clipboard
Cocona does not recognize subcommand alias
Environment
-
<TargetFramework>net8.0</TargetFramework>
-
<PackageReference Include="Cocona" Version="2.2.0" />
Steps To Reproduce
- Create a
JiraCommands
class with at lease oneCommand
- Compile the
Main
listed below. - Run:
.\Demo.exe --help
- Output will include:
jira Sub commands can be used to query Jira.
- notice that there is no mention of the
j
alias
- notice that there is no mention of the
- Output will include:
- Run:
.\Demo.exe jira --help
- Output displays the expected commands
- Run:
.\Demo.exe j --help
- Output displays:
'j' is not a command.
- Output displays:
Results
Expected Results
- Expected to use
j
orjira
interchangeably
Actual Results
- can run
jira
command -
cannot run
j
command -
j
alias does not appear in the help
Sample Code
internal class Program
{
static void Main()
{
var builder = CoconaApp.CreateBuilder();
var application = builder.Build();
application.AddSubCommand("jira", x =>
{
x.AddCommands<JiraCommands>();
})
.WithDescription("Sub commands can be used to query Jira.")
.WithAliases(new[] { "j" });
application.Run();
}
}