Beispiel #1
0
func usageFunc(cmd *cobra.Command) error {
	subCommands := getSubCommands(cmd)
	tabOut := getTabOutWithWriter(os.Stdout)
	commandUsageTemplate.Execute(tabOut, struct {
		Cmd         *cobra.Command
		LocalFlags  string
		GlobalFlags string
		SubCommands []*cobra.Command
		Version     string
	}{
		cmd,
		rktFlagUsages(cmd.LocalFlags()),
		rktFlagUsages(cmd.InheritedFlags()),
		subCommands,
		version.Version,
	})
	tabOut.Flush()
	return nil
}