type subcommands … func (s subcommands) DetailedHelp(f *flag.FlagSet) { … } func (s subcommands) Usage() string { … } func (s subcommands) Run(ctx context.Context, args ...string) error { … } func (s subcommands) Commands() []tool.Application { … } // getSubcommands returns the subcommands of a given Application. func getSubcommands(a tool.Application) []tool.Application { … }