func executeRulesChildren(cmd *cobra.Command, info *validator.StatusLog, ruleConfig *RuleConfig, userValidatorConfig *ValidatorConfig) []validator.ValidationError {
	if skipCommand(userValidatorConfig, cmd.CommandPath()+"*") {
		return info.Errors
	}
	children := cmd.Commands()
	for _, child := range children {
		if !child.IsAvailableCommand() || child.IsAdditionalHelpTopicCommand() {
			continue
		}
		validate(child, info, ruleConfig, userValidatorConfig)
	}
	return info.Errors
}
executeRulesChildren execute rules on children of cmd
package rules
import (
	"fmt"
	"os"
	"github.com/aerogear/charmil/validator"
	"github.com/spf13/cobra"
)
type Rules interface {
	Validate(cmd *cobra.Command) []validator.ValidationError
}
type RuleConfig struct {
	Rules []Rules
}
func ExecuteRulesInternal(cmd *cobra.Command, ruleConfig *RuleConfig, userValidatorConfig *ValidatorConfig) []validator.ValidationError {
	var errors []validator.ValidationError
	info := validator.StatusLog{TotalTested: 0, TotalErrors: 0, Errors: errors}
	if skipCommand(userValidatorConfig, cmd.CommandPath()+"*") {
		return info.Errors
	}
	initDefaultRules(userValidatorConfig, ruleConfig)
	validate(cmd, &info, ruleConfig, userValidatorConfig)
	return executeHelper(cmd, &info, ruleConfig, userValidatorConfig)
}
func executeHelper(cmd *cobra.Command, info *validator.StatusLog, ruleConfig *RuleConfig, userValidatorConfig *ValidatorConfig) []validator.ValidationError {
	info.Errors = executeRecursive(cmd, info, ruleConfig, userValidatorConfig)
	fmt.Fprintf(os.Stderr, "commands checked: %d\nchecks failed: %d\n", info.TotalTested, info.TotalErrors)
	return info.Errors
}
func executeRecursive(cmd *cobra.Command, info *validator.StatusLog, ruleConfig *RuleConfig, userValidatorConfig *ValidatorConfig) []validator.ValidationError {
	for _, child := range cmd.Commands() {
		if !child.IsAvailableCommand() || child.IsAdditionalHelpTopicCommand() {
			continue
		}
		info.Errors = executeRecursive(child, info, ruleConfig, userValidatorConfig)
	}
	info.Errors = executeRulesChildren(cmd, info, ruleConfig, userValidatorConfig)
	return info.Errors
}