-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
If a structure type field responding to a defined interface is present within the arguments structure, this field is therefore considered as an "automatic" subcommand (compared to manual that plays with the stop behavior).
When encountered and if matching the program's arguments, the interface's function is executed when argument parsing is finised and the leftovers are parsed against this structure, and so on recursively (that is, a first level subcommand is not executed when one of its fields also responds this interface).
The substructure must respond the following interface:
type Command interface {
Launch(parameters interface{}, leftover []string)
}parametershold a pointer to the root parameters structure.leftoverholds a list of remaining positional arguments