Closed Tyrrrz closed 5 years ago
Implemented as an attribute property GroupName
. When scanning input, the group is recognized from the first option. Options from a different group are ignored.
Removed this feature. Need to rethink how it should be implemented based on actual use cases.
Would be cool to have this feature implemented. Currently, I use two not required options and custom validation, but it isn't the right way.
We currently have long list of commands (thanks for publishing the alphabetised feature, so much easier now :) ) and it would be nice to shorten the list so that commands that have the same beginning are grouped under that top level command. eg. as per the attached screenshot we currently have...
device info Get the device info
device mac Read the ESP32's MAC address
device name Get the name of the Meadow
device provision Registers and prepares connected device for use with Meadow Cloud
I would love a way for this list to be compressed down to something like.
device [info, mac, name, provision]
then when I type meadow device --help
it would expand to the full description as per the initial example, but just for that command group.
@CartBlanche this is a bit unrelated to this issue (it talks about option groups), but you can achieve exactly what you want by creating a dummy command, e.g. device
that just throws a CommandException
on execution. You can configure the exception to guide the user to child commands and also automatically show the help text.
[Command("device")]
public class DeviceCommand : ICommand
{
public ValueTask ExecuteAsync(IConsole console) =>
throw new CommandException("Use one of the child commands", true);
}
This will make all your other device ...
commands nest underneath this device
command.
Specify a group on an option. Options from the same group can/cannot be used simultaneously.