Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "benchy", PersistentPreRunE: func(cmd *cobra.Command, args []string) error { sub := cmd subFlags := args for { if err := viper.BindPFlags(sub.Flags()); err != nil { return errors.Wrapf(err, "failed to bind flags for %s", sub.Name()) } if err := viper.BindPFlags(sub.PersistentFlags()); err != nil { return errors.Wrapf(err, "failed to bind persistent flags for %s", sub.Name()) } potentialSub, potentialSubFlags, err := sub.Find(subFlags) if err != nil { return errors.Wrapf(err, "failed to get child for %s", sub.Name()) } if sub == potentialSub { break } sub = potentialSub subFlags = potentialSubFlags } return nil }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.