// PrintHelpWithCommand generates and prints command line help for a Command
974614
func PrintHelpWithCommand(flagMap map[string]reflect.StructField, defaultValMap map[string]reflect.Value, parsers map[reflect.Type]parse.Parser, cmd *Command, subCmd []*Command) error {
	// Hide command from help
	if cmd != nil && cmd.HideHelp {
		return fmt.Errorf("command %s not found", cmd.Name)
	}

	// Define a templates
	// Using POSXE STD : http://pubs.opengroup.org/onlinepubs/9699919799/
	const helper = `{{if .ProgDescription}}{{.ProgDescription}}

{{end}}Usage: {{.ProgName}} [flags] <command> [<arguments>]

Use "{{.ProgName}} <command> --help" for help on any command.
{{if .SubCommands}}
Commands:{{range $subCmdName, $subCmdDesc := .SubCommands}}
{{printf "\t%-50s %s" $subCmdName $subCmdDesc}}{{end}}
{{end}}
Flag's usage: {{.ProgName}} [--flag=flag_argument] [-f[flag_argument]] ...     set flag_argument to flag(s)
          or: {{.ProgName}} [--flag[=true|false| ]] [-f[true|false| ]] ...     set true/false to boolean flag(s)

Flags:
`
	// Use a struct to give data to template
	type TempStruct struct {
		ProgName        string
		ProgDescription string
		SubCommands     map[string]string
	}
	tempStruct := TempStruct{}
	if cmd != nil {
		tempStruct.ProgName = cmd.Name
		tempStruct.ProgDescription = cmd.Description
		tempStruct.SubCommands = map[string]string{}
		if len(subCmd) > 1 && cmd == subCmd[0] {
			for _, c := range subCmd[1:] {
				if !c.HideHelp {
					tempStruct.SubCommands[c.Name] = c.Description
				}
			}
		}
	} else {
		_, tempStruct.ProgName = path.Split(os.Args[0])
	}

	// Run Template
	tmplHelper, err := template.New("helper").Parse(helper)
	if err != nil {
		return err
	}
	err = tmplHelper.Execute(os.Stdout, tempStruct)
	if err != nil {
		return err
	}

	return printFlagsDescriptionsDefaultValues(flagMap, defaultValMap, parsers, os.Stdout)
}
1166572
func Print(v ...interface{}) {
	if Severity >= LevelInfo {
		std.Output(5, fmt.Sprint(v...), LevelInfo)
	}
}
1302512
func Print(foreground, background Color, v ...interface{}) (int, error) {
	return Fprint(os.Stdout, foreground, background, v...)
}
84110
func (g *Generator) Printf(format string, args ...interface{}) {
	g.Buf.WriteString(fmt.Sprintf(format, args...))
}
1146329
func ShowHelp(err io.Writer) func(*cobra.Command, []string) error {
	return func(cmd *cobra.Command, args []string) error {
		cmd.SetOutput(err)
		cmd.HelpFunc()(cmd, args)
		return nil
	}
}
357544
func (mf *MultiFlag) PrintHelp() error {
	descriptors := make(optionDescriptorSlice, len(mf.Options))
	for idx, opt := range mf.Options {
		descriptors[idx] = opt.Descriptor()
	}
	sort.Sort(descriptors)

	fmt.Fprintln(mf.Output, mf.Description)
	return writeAlignedOptionDescriptors(mf.Output, []*OptionDescriptor(descriptors))
}
71914
func (p *printer) Printf(format string, a ...interface{}) {
	if p.Err == nil {
		_, p.Err = fmt.Fprintf(&p.Out, format, a...)
	}
}
445112
func (t *Tee) Printf(format string, args ...interface{}) (int, error) {
	s := fmt.Sprintf(format, args...)
	n, err := os.Stdout.WriteString(s)
	if err != nil {
		return n, err
	}

	if t.f == nil {
		return n, err
	}

	return t.f.WriteString(s)
}
844984
func (a *Writer) Print(args ...interface{}) (int, error) {
	return fmt.Fprint(a.w, args...)
}
1200850
func (c *Conn) printLine(cmd string, args ...interface{}) {
	io.WriteString(c.c.W, cmd)
	for _, a := range args {
		c.c.W.Write(space)
		fmt.Fprint(c.c.W, a)
	}
	c.c.W.Write(crnl)
}
523278
func (n *LevelLogger) Print(v ...interface{}) {
	if !n.Enabled() {
		return
	}
	n.mu.RLock()
	n.logger.Output(callDepth, fmt.Sprint(v...))
	n.mu.RUnlock()
}
198689
func die(printHelp bool, format string, args ...interface{}) {
	if printHelp {
		fmt.Print(HELP)
	}
	fmt.Printf(format, args...)
	fmt.Println("")
	os.Exit(1)
}
762183
func printFmt(l, v string, args ...interface{}) {
	l = label(l, subIndent, valIndent)
	fmt.Printf("%s %s\n", l, fmt.Sprintf(v, args...))
}
305545
func HelpCommandFn(ctx *Context) error {
	var (
		args   = ctx.NativeArgs()
		parent = ctx.Command().Parent()
	)
	if len(args) == 0 {
		ctx.String(parent.Usage(ctx))
		return nil
	}
	var (
		child = parent.Route(args)
		clr   = ctx.Color()
	)
	if child == nil {
		return fmt.Errorf("command %s not found", clr.Yellow(strings.Join(args, " ")))
	}
	ctx.String(child.Usage(ctx))
	return nil
}
188967
func (tp *TabPrinter) Print(arg interface{}) {
	if tp.current > 0 {
		if (tp.current % tp.max) == 0 {
			fmt.Fprintln(tp.w, "")
			tp.w.Flush()
			tp.current = 0
		} else {
			fmt.Fprint(tp.w, "\t")
		}
	}

	tp.current++
	fmt.Fprint(tp.w, arg)
}
1096214
func (ld Loader) PrintHelp(cfg interface{}) {
	w := bufio.NewWriter(os.Stderr)
	ld.fprintHelp(w, cfg, stderr())
	w.Flush()
}
778789
func (ld Loader) FprintHelp(w io.Writer, cfg interface{}) {
	ld.fprintHelp(w, cfg, monochrome())
}