// PrintAllCommands prints a help text for all registered commands to the given Logger.
554488
func PrintAllCommands(logger logutil.Logger) {
	for _, group := range commands {
		if group.Name == "Debugging" {
			continue
		}
		logger.Printf("%v: %v\n", group.Name, group.Description)
		for _, cmd := range group.Commands {
			logger.Printf("  %v %v\n", cmd.Name, cmd.Params)
		}
		logger.Printf("\n")
	}
}
1141302
func rootCommands() {
	for _, cmd := range root.Command.Commands() {
		if !cmd.Hidden {
			fmt.Printf("%s ", cmd.Name())
		}
	}
}
893481
func (me *Logger) print(priority int, v ...interface{}) {
	if priority <= me.priority {
		me.setFullPrefix(priority)
		me.logger.Print(v...)
	}
}
667551
func (l *Logger) Printf(format string, args ...interface{}) {
	l.logf(l.app, logLevelNotice, format, false, args...)
}
731750
func (l *Logger) LogCmd(cmd *exec.Cmd, format string, a ...interface{}) (int, error) {
	code := -1
	f := func() error {
		cmdLine := QuotedCmd(cmd)
		l.Debug("executing: %s", cmdLine)

		stdout := &bytes.Buffer{}
		stderr := &bytes.Buffer{}
		cmd.Stdout = stdout
		cmd.Stderr = stderr
		if err := cmd.Run(); err != nil {
			if exitErr, ok := err.(*exec.ExitError); ok {
				code = exitErr.Sys().(syscall.WaitStatus).ExitStatus()
			}
			return fmt.Errorf("%v: Cmd: %s Stdout: %q Stderr: %q", err, cmdLine, stdout.Bytes(), stderr.Bytes())
		}
		return nil
	}
	err := l.LogOp(f, format, a...)
	return code, err
}
385053
func (l *Logger) Printf(format string, v ...interface{}) {
	l.Fprint(l.flags, LEVEL_PRINT, 2, fmt.Sprintf(format, v...), nil)
}
1145152
func Print(vs ...interface{}) {
	args, options := extractOptions(vs...)
	New(os.Stdout, options...).Print(args...)
}
1233357
func commandHelp(args string, ui plugin.UI) {
	if args == "" {
		help := usage(false)
		help = help + `
  :   Clear focus/ignore/hide/tagfocus/tagignore

  type "help <cmd|option>" for more information
`

		ui.Print(help)
		return
	}

	if c := pprofCommands[args]; c != nil {
		ui.Print(c.help(args))
		return
	}

	if v := pprofVariables[args]; v != nil {
		ui.Print(v.help + "\n")
		return
	}

	ui.PrintErr("Unknown command: " + args)
}
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)
}
340241
func (p FmtPrinter) Printf(logger *Logger, format string, a ...interface{}) {
	format = "%s " + format
	b := make([]interface{}, 1)
	b[0] = logger.Color(logger.Name)
	a = append(b, a...)
	fmt.Fprintf(os.Stderr, format, a...)
}
606785
func (cmd *Cmd) help(line string) (stop bool) {
	fmt.Println("")

	if line == "--all" {
		fmt.Println("Available commands (use 'help <topic>'):")
		fmt.Println("================================================================")
		for _, c := range cmd.commandNames {
			fmt.Printf("%v: ", c)
			cmd.Commands[c].HelpFunc()
		}
	} else if len(line) == 0 {
		fmt.Println("Available commands (use 'help <topic>'):")
		fmt.Println("================================================================")

		max := 0

		for _, c := range cmd.commandNames {
			if len(c) > max {
				max = len(c)
			}
		}

		tp := pretty.NewTabPrinter(80 / (max + 1))
		tp.TabWidth(max + 1)

		for _, c := range cmd.commandNames {
			tp.Print(c)
		}
		tp.Println()
	} else {
		if c, ok := cmd.Commands[line]; ok {
			c.HelpFunc()
		} else {
			fmt.Println("unknown command or function")
		}
	}

	fmt.Println("")
	return
}
851002
func LogsCommand(factory app.ProjectFactory) cli.Command {
	return cli.Command{
		Name:   "logs",
		Usage:  "Get service logs",
		Action: app.WithProject(factory, app.ProjectLog),
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "follow",
				Usage: "Follow log output.",
			},
		},
	}
}
614874
func (c *Comandante) collectCommandsForHelp() []*printableCommand {
	// find the longest command
	longest := 0
	for _, cmd := range c.registeredCommands {
		if len(cmd.Name) > longest {
			longest = len(cmd.Name)
		}
	}

	// pad all commands
	commands := make([]*printableCommand, len(c.registeredCommands))
	formatter := "%-" + strconv.Itoa(longest) + "s"
	for i, cmd := range c.registeredCommands {
		commands[i] = &printableCommand{
			PaddedName:  fmt.Sprintf(formatter, cmd.Name),
			Description: cmd.ShortDescription,
		}
	}

	sort.Sort(PrintableCommandsByName{commands})

	return commands
}
1208901
func (l *Log) Printf(format string, args ...interface{}) {
	if l.loadCustomLogger() {
		l.customLogger.Printf(format, args...)
		return
	}
	l.deflogger.Printf(format, args...)
}
262141
func (entry *Entry) Print(args ...interface{}) {
	if entry.lgEntry.Logger.Level >= lg.InfoLevel {
		entry.lgEntry.WithFields(entry.fields).Info(args...)
	}
}
61352
func (l *DistinctLogger) Println(v ...interface{}) {
	// fmt.Sprint doesn't add space between string arguments
	logStatement := strings.TrimSpace(fmt.Sprintln(v...))
	l.print(logStatement)
}
675638
func (l *Logger) Println(args ...interface{}) {
	l.mu.Lock()
	defer l.mu.Unlock()
	fmt.Fprintln(l.Out, args...)
}