// Usage prints a general usage statement
494410
func Usage(r *RootCMD, c *CMD) {
	translate.Printf("SUBCOMMAND USAGE", r.Name, c.Name)
	t := reflect.TypeOf(c.Args).Elem()
	max := 0
	for i := 0; i < t.NumField(); i++ {
		name := t.Field(i).Name
		fmt.Printf(" <%s>", name)
		if len(name) > max {
			max = len(name)
		}
	}
	print("\n\n")
	translate.Printf("DESCRIPTION", c.Short)
	print("\n\n")
	if t.NumField() > 0 {
		translate.Printf("ARGUMENTS")
		print("\n\n")
		for i := 0; i < t.NumField(); i++ {
			fmt.Printf("%"+strconv.Itoa(max+4)+"s : %s\n", t.Field(i).Name, t.Field(i).Tag.Get("desc"))
		}
		print("\n")
	}
	if r.Flags != nil {
		translate.Printf("GLOBAL FLAGS")
		print("\n\n")
		PrintFlags(r.Flags)
	}
}
1330611
func (o *objectCountEvaluator) UsageStats(options quota.UsageStatsOptions) (quota.UsageStats, error) {
	return CalculateUsageStats(options, o.listFuncByNamespace, MatchesNoScopeFunc, o.Usage)
}
1262894
func (s *Server) Use(filters ...Filter) {
	s.filters = append(s.filters, filters...)
}
644835
func commandUsage(method string) {
	usage, err := btcjson.MethodUsageText(method)
	if err != nil {
		// This should never happen since the method was already checked
		// before calling this function, but be safe.
		fmt.Fprintln(os.Stderr, "Failed to obtain command usage:", err)
		return
	}

	fmt.Fprintln(os.Stderr, "Usage:")
	fmt.Fprintf(os.Stderr, "  %s\n", usage)
}
1105282
func (o *objectCountEvaluator) Usage(object runtime.Object) (corev1.ResourceList, error) {
	quantity := resource.NewQuantity(1, resource.DecimalSI)
	resourceList := corev1.ResourceList{}
	for _, resourceName := range o.resourceNames {
		resourceList[resourceName] = *quantity
	}
	return resourceList, nil
}
696
func GetUsage() Usage {
	memStats := new(runtime.MemStats)
	runtime.ReadMemStats(memStats)
	return Usage{
		Mem: memStats.Sys,
	}
}
749832
func Use(c context.Context, s Client) context.Context {
	return context.WithValue(c, &contextKey, s)
}
1001362
func (a *ActDepend) Use(ind int) ActionInterface {
	return a.getIndex(ind).Wrap()
}
771494
func (cmd *CLI) Usage() {
	if cmd.usage == nil {
		cmd.usage = cmd.DefaultUsage
	}
	cmd.usage()
}
396807
func (s *Snapshotter) Usage(ctx context.Context, key string) (snapshots.Usage, error) {
	log.G(ctx).WithField("key", key).Debug("usage")

	var (
		id    string
		err   error
		info  snapshots.Info
		usage snapshots.Usage
	)

	err = s.withTransaction(ctx, false, func(ctx context.Context) error {
		id, info, usage, err = storage.GetInfo(ctx, key)
		if err != nil {
			return err
		}

		if info.Kind == snapshots.KindActive {
			deviceName := s.getDeviceName(id)
			usage.Size, err = s.pool.GetUsage(deviceName)
			if err != nil {
				return err
			}
		}

		if info.Parent != "" {
			// GetInfo returns total number of bytes used by a snapshot (including parent).
			// So subtract parent usage in order to get delta consumed by layer itself.
			_, _, parentUsage, err := storage.GetInfo(ctx, info.Parent)
			if err != nil {
				return err
			}

			usage.Size -= parentUsage.Size
		}

		return err
	})

	return usage, err
}
689339
func (s *PrioritySlot) Use(ctx context.Context, priority int) context.Context {
	ctx, cancel := context.WithCancel(ctx)
	s.mu.Lock()
	defer s.mu.Unlock()
	if s.shutdown {
		// Not accepting new processes.
		cancel()
		return ctx
	}
	if s.cancel == nil {
		// First use
		s.cancel = cancel
		s.priority = priority
		return ctx
	}
	if s.priority <= priority {
		// Argument wins
		s.cancel()
		s.cancel = cancel
		s.priority = priority
		return ctx
	}
	// Incumbent wins
	cancel()
	return ctx
}
1322881
func (c *Command) UsageString() string {
	return fmt.Sprintf("usage:\n\n\t$ badwolf %s\n\n%s\n", c.UsageLine, strings.TrimSpace(c.Long))
}
358303
func (w *Weavebox) Use(handlers ...Middleware) {
	for _, h := range handlers {
		w.middleware = append(w.middleware, h)
	}
}
1021895
func (p *podEvaluator) Usage(item runtime.Object) (corev1.ResourceList, error) {
	// delegate to normal usage
	return PodUsageFunc(item, p.clock)
}
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()
}
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)
	}
}
537792
func (p *CmdProve) GetUsage() libkb.Usage {
	return libkb.Usage{
		Config:    true,
		API:       true,
		KbKeyring: true,
	}
}