-
-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't show command examples at root #189
Comments
Hi, this is really an issue where you have complex sub commands and you need to show a list of examples per sub command. Hope this gets scheduled for fix in the next release, btw fantastic library! 👏 |
@libe Thank you! I'm currently on vacation until August and haven't really planned on working a lot on Spectre.Console during this time, but if you feel that this is important, a PR is always appreciated! 😊 |
Hi @patriksvensson, I have marked this issue as being fully address by PR #1252, not because it removes the default behaviour of displaying examples from direct children when the root contains none. Rather because you can now turn this behaviour off, if desired, by fixture.Configure(configurator =>
{
configurator.SetApplicationName("myapp");
// Show the first 8 examples defined on the direct children
configurator.Settings.MaximumIndirectExamples = 8;
configurator.AddCommand<DogCommand>("dog")
.WithExample("dog", "--name", "Rufus", "--age", "12", "--good-boy")
.WithExample("dog", "--name", "Luna")
.WithExample("dog", "--name", "Charlie")
.WithExample("dog", "--name", "Bella")
.WithExample("dog", "--name", "Daisy")
.WithExample("dog", "--name", "Milo");
configurator.AddCommand<HorseCommand>("horse")
.WithExample("horse", "--name", "Brutus")
.WithExample("horse", "--name", "Sugar", "--IsAlive", "false")
.WithExample("horse", "--name", "Cash")
.WithExample("horse", "--name", "Dakota")
.WithExample("horse", "--name", "Cisco")
.WithExample("horse", "--name", "Spirit");
}); At one point in the PR, I had removed the code to display examples from children entirely, but felt it was heavyhanded and may have removed what could be quite a useful default behaviour. For example, the issue #1180 (which is quite a bit newer than this one) makes no mention of the need to remove the default behaviour. Anyhow, that's a more in-depth explanation of why the PR has been implemented as it has been. |
Only examples specified on the root should show at the root. If examples are specified for commands it should not show up at the root since this is a bit confusing.
The text was updated successfully, but these errors were encountered: