// Usage outputs a usage error and exits with error code 64
545603
func Usage(format string, a ...interface{}) {
	console.ErrStyle("usage", format, a...)
	os.Exit(BadUsage)
}
230753
func (fs *FlagSet) usage() {
	if fs == CommandLine {
		Usage()
	} else if fs.Usage == nil {
		defaultUsage(fs)
	} else {
		fs.Usage()
	}
}
222702
func (r *RootCMD) Usage() {
	translate.Printf("ROOT USAGE", r.Name)
	print("\n\n")
	if len(r.Short) > 0 {
		translate.Printf("DESCRIPTION", r.Short)
		print("\n\n")
	}
	translate.Printf("COMMANDS")
	print("\n\n")
	var keys []string
	maxKey := 0
	maxAlias := 0
	for key, cmd := range r.Subcommands {
		keys = append(keys, key)
		if len(key) > maxKey {
			maxKey = len(key)
		}
		if len(cmd.Alias) > maxAlias {
			maxAlias = len(cmd.Alias)
		}
	}
	maxAlias += 2
	sort.Strings(keys)
	format := "    %" + strconv.Itoa(maxKey) + "s %" + strconv.Itoa(maxAlias) + "s : %s\n"
	for _, k := range keys {
		fmt.Printf(format, k, "("+r.Subcommands[k].Alias+")", r.Subcommands[k].Short)
	}
	print("\n")
	if r.Flags != nil {
		translate.Printf("GLOBAL FLAGS")
		print("\n\n")
		PrintFlags(r.Flags)
	}
	os.Exit(1)
}
948672
func (fs *FlagSet) Usage() string {
	var flags []string

	// If there is no "help" flag defined, we will use it to display help/usage
	// (default FlagSet).
	if fs.F.Lookup("help") == nil {
		flags = append(flags, "help")
	}

	fs.F.VisitAll(func(f *flag.Flag) {
		comma := ""
		if len(flags) > 0 {
			comma = ","
		}
		flags = append(flags, fmt.Sprintf("[%s%s]", comma, f.Name))
	})
	return strings.Join(flags, "")
}
688266
func (c *Command) UsageFunc() (f func(*Command) error) {
	if c.usageFunc != nil {
		return c.usageFunc
	}
	if c.HasParent() {
		return c.Parent().UsageFunc()
	}
	return func(c *Command) error {
		c.mergePersistentFlags()
		err := tmpl(c.OutOrStderr(), c.UsageTemplate(), c)
		if err != nil {
			c.Println(err)
		}
		return err
	}
}
490929
func (r *PortAllocator) Used() int {
	return r.portRange.Size - r.alloc.Free()
}
749832
func Use(c context.Context, s Client) context.Context {
	return context.WithValue(c, &contextKey, s)
}
393247
func usage(commandLine bool) string {
	var prefix string
	if commandLine {
		prefix = "-"
	}
	fmtHelp := func(c, d string) string {
		return fmt.Sprintf("    %-16s %s", c, strings.SplitN(d, "\n", 2)[0])
	}

	var commands []string
	for name, cmd := range pprofCommands {
		commands = append(commands, fmtHelp(prefix+name, cmd.description))
	}
	sort.Strings(commands)

	var help string
	if commandLine {
		help = "  Output formats (select at most one):\n"
	} else {
		help = "  Commands:\n"
		commands = append(commands, fmtHelp("o/options", "List options and their current values"))
		commands = append(commands, fmtHelp("quit/exit/^D", "Exit pprof"))
	}

	help = help + strings.Join(commands, "\n") + "\n\n" +
		"  Options:\n"

	// Print help for variables after sorting them.
	// Collect radio variables by their group name to print them together.
	radioOptions := make(map[string][]string)
	var variables []string
	for name, vr := range pprofVariables {
		if vr.group != "" {
			radioOptions[vr.group] = append(radioOptions[vr.group], name)
			continue
		}
		variables = append(variables, fmtHelp(prefix+name, vr.help))
	}
	sort.Strings(variables)

	help = help + strings.Join(variables, "\n") + "\n\n" +
		"  Option groups (only set one per group):\n"

	var radioStrings []string
	for radio, ops := range radioOptions {
		sort.Strings(ops)
		s := []string{fmtHelp(radio, "")}
		for _, op := range ops {
			s = append(s, "  "+fmtHelp(prefix+op, pprofVariables[op].help))
		}

		radioStrings = append(radioStrings, strings.Join(s, "\n"))
	}
	sort.Strings(radioStrings)
	return help + strings.Join(radioStrings, "\n")
}
501189
func (r *Router) Use(middlewares ...Middleware) {
	r.middlewares = append(r.middlewares, middlewares...)
}
308554
func (cmd *CLI) UsageString() string {
	hasSubCommands := len(cmd.subCommands) > 0
	hasDescription := len(cmd.description) > 0
	hasLongDescription := len(cmd.longDescription) > 0

	// Prefetch table to calculate the widths
	_ = cmd.SubCommandsUsageString("")
	_ = cmd.FlagsUsageString("")

	// Start the Buffer
	var buff bytes.Buffer

	buff.WriteString("Usage:\n")
	buff.WriteString(cmd.CommandUsageString())

	// Write Sub Command Syntax
	if hasSubCommands {
		buff.WriteString(" <command> [arg...]")
	}

	if hasLongDescription {
		buff.WriteString(fmt.Sprintf("\n\n%s", cmd.LongDescription()))
	} else if hasDescription {
		buff.WriteString(fmt.Sprintf("\n\n%s", cmd.Description()))
	}

	// Write Options Syntax
	buff.WriteString(cmd.FlagsUsageString("Options"))

	// Write Sub Command List
	if hasSubCommands {
		buff.WriteString(cmd.SubCommandsUsageString("Commands"))
	}

	// Return buffer as string
	return buff.String()
}
401399
func (j *Journal) GetUsage() (uint64, error) {
	var out C.uint64_t

	sd_journal_get_usage, err := getFunction("sd_journal_get_usage")
	if err != nil {
		return 0, err
	}

	j.mu.Lock()
	r := C.my_sd_journal_get_usage(sd_journal_get_usage, j.cjournal, &out)
	j.mu.Unlock()

	if r < 0 {
		return 0, fmt.Errorf("failed to get journal disk space usage: %d", syscall.Errno(-r))
	}

	return uint64(out), nil
}
540575
func (cmd *Command) Usage(ctx *Context) string {
	if cmd.UsageFn != nil {
		return cmd.UsageFn()
	}
	return cmd.defaultUsageFn(ctx)
}
698252
func (r *Router) Use(mwf ...MiddlewareFunc) {
	for _, fn := range mwf {
		r.middlewares = append(r.middlewares, fn)
	}
}
358303
func (w *Weavebox) Use(handlers ...Middleware) {
	for _, h := range handlers {
		w.middleware = append(w.middleware, h)
	}
}
612214
func (a *Application) Usage(args []string) {
	context, err := a.parseContext(true, args)
	a.FatalIfError(err, "")
	if err := a.UsageForContextWithTemplate(context, 2, a.usageTemplate); err != nil {
		panic(err)
	}
}
60731
func (a *Application) FatalUsage(format string, args ...interface{}) {
	a.Errorf(format, args...)
	// Force usage to go to error output.
	a.usageWriter = a.errorWriter
	a.Usage([]string{})
	a.terminate(1)
}
712372
func (this *Beanstalkd) Use(tube string) error {
	e := this.send("use %s\r\n", tube)
	if e != nil {
		return e
	}

	reply, e := this.recvline()
	if e != nil {
		return e
	}
	var usedTube string
	_, e = fmt.Sscanf(reply, "USING %s\r\n", &usedTube)
	if e != nil || tube != usedTube {
		return errors.New(reply)
	}
	return nil
}