-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Support for option groups #92
Comments
I would use this possibility to group the documentation / usage output for better understanding... Let's take my project
Usually, I would create a usage output in alphabetical order, but it would be a huge usability improvement to have them grouped depending on the purpose. |
@sandreas in your use case, you're primarily looking after grouping inside the help text, right? Are you also interested in how it affects parsing, i.e. not being able to use both |
Correct. Example [Command]
[GroupDescription("direction", "Options to choose the direction")]
[GroupDescription("meta", "Options to modify metadata")]
public class MetaCommand : ICommand
{
[Group("direction")]
[CommandOption("left")]
public string Left { get; init; } = "Hello";
[Group("direction")]
[CommandOption("right")]
public string Right { get; init; } = "world";
[Group("meta")]
[CommandOption("meta-album")]
public string MetaAlbum { get; init; } = "";
[Group("meta")]
[CommandOption("meta-artist")]
public string MetaArtist { get; init; } = "";
public ValueTask ExecuteAsync(IConsole console)
{
console.Output.Write(Left);
console.Output.Write(' ');
console.Output.Write(Right);
return default;
}
}
While that would be an interesting thing to have, in my use case this would not have much benefit, because Maybe this is just a problem of terminology. In my head groups are things that somehow belong together logically, while Constraints would be things that restrict others, are mutually exclusive or depend on each other. Constraints would be much more complex to configure, I doubt that this would be convenient to do without prepared templates (e.g. for While groups sound interesting, I probably wouldn't use constraints too much, but maybe I'm the wrong person to talk about these :-) |
The original idea behind groups did envision some form of constraints, so I'm gathering feedback whether this is what users expect to find behind that functionality. |
Related to #6
Curious what are the potential use cases people have for this?
An obvious one is making two options mutually exclusive, but maybe there is something else?
The text was updated successfully, but these errors were encountered: