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)
}
parameters hold a pointer to the root parameters structure.
leftover holds a list of remaining positional arguments
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:
parametershold a pointer to the root parameters structure.leftoverholds a list of remaining positional arguments