Combining Branch + Command #1305
phillip-haydon
started this conversation in
General
Replies: 1 comment
-
@phillip-haydon Branches may have a default, or they may not. What you describe can be achieved by config.AddBranch("status", b =>
{
b.SetDefaultCommand<ServiceCommand>();
b.AddCommand<ServiceCommand>("service");
b.AddCommand<AppsCommand>("apps");
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
I was playing around trying to see if I could combine a command and a branch, so I could do a 'default' command on the branch...
i.e I want to be able to have
app.exe status
app.exe status service
app.exe status apps
Where status is a branch but if
service
orapps
isnt passed in, it would default toservice
.What actually happens is you end up with 2 commands listed for
status
the command varient and the branch varient. But only the command varient can be executed.So I'm not sure if you would call it a bug, or something that spectre should throw up on and tell me I'm dumb when I try to run it.
To Reproduce
Expected behavior
I'm not sure what to expect.
Either:
Beta Was this translation helpful? Give feedback.
All reactions