// CheckArgs should be used to ensure the right command line arguments are
// passed before executing an example.
166607
func CheckArgs(arg ...string) {
	if len(os.Args) < len(arg)+1 {
		Warning("Usage: %s %s", os.Args[0], strings.Join(arg, " "))
		os.Exit(1)
	}
}
139456
func (fs *FlagSet) Arg(i int) string {
	if i < 0 || i >= len(fs.args) {
		return ""
	}
	return fs.args[i]
}
952200
func (h *multiHandler) Args() bool {
	for _, handler := range h.handlers {
		if handler.Args() {
			return true
		}
	}
	return false
}
1145983
func getArgs(genericParams map[string]interface{}) ([]string, error) {
	args := []string{}
	val, found := genericParams["args"]
	if found {
		var isArray bool
		args, isArray = val.([]string)
		if !isArray {
			return nil, fmt.Errorf("expected []string, found: %v", val)
		}
		delete(genericParams, "args")
	}
	return args, nil
}
526267
func (e *loginProvision) checkArg() error {
	// check we have a good device type:
	if e.arg.DeviceType != libkb.DeviceTypeDesktop && e.arg.DeviceType != libkb.DeviceTypeMobile {
		return libkb.InvalidArgumentError{Msg: fmt.Sprintf("device type must be %q or %q, not %q", libkb.DeviceTypeDesktop, libkb.DeviceTypeMobile, e.arg.DeviceType)}
	}

	if e.arg.User == nil {
		return libkb.InvalidArgumentError{Msg: "User cannot be nil"}
	}

	return nil
}
60451
func ArgsArg(r, o int) ArgSpec {
	return ArgSpec(C._go_MRB_ARGS_ARG(C.int(r), C.int(o)))
}
5715
func (m *Monitor) templateCheckArgs(check *Check, svc *service.Service) string {
	funcMap := template.FuncMap{
		"tcp":       func(p int64) int64 { return svc.PortForServicePort(p, "tcp") },
		"udp":       func(p int64) int64 { return svc.PortForServicePort(p, "udp") },
		"host":      func() string { return m.DefaultCheckHost },
		"container": func() string { return svc.Hostname },
	}

	t, err := template.New("check").Funcs(funcMap).Parse(check.Args)
	if err != nil {
		log.Errorf("Unable to parse check Args: '%s'", check.Args)
		return check.Args
	}

	var output bytes.Buffer
	t.Execute(&output, svc)

	return output.String()
}
471836
func (p *EnumParam) Args() []string {
	if p.value == nil {
		return []string{}
	}
	return []string{fmt.Sprintf("--%v", p.CLIName()), *p.value}
}
116854
func (c *Command) Args() []*Arg {
	ret := make([]*Arg, len(c.args))
	copy(ret, c.args)

	return ret
}
688413
func (c *GroupsSetPurposeCall) ValidateArgs() error {
	if len(c.channel) <= 0 {
		return errors.New(`required field channel not initialized`)
	}
	if len(c.purpose) <= 0 {
		return errors.New(`required field purpose not initialized`)
	}
	return nil
}
492000
func MakeCommandLineArgs(s string) []string {
	r := []string{}
	for _, part := range safeSplit(s) {
		if len(part) == 0 {
			continue
		}
		r = append(r, part)
	}
	return r
}
1287628
func (c *Cmd) WithArgs(args ...CmdArg) *Cmd {
	c.args = args
	return c
}
947916
func (a *AskPassCredentialHelper) args(prompt string) []string {
	if len(prompt) == 0 {
		return nil
	}
	return []string{prompt}
}
1265829
func (c *GroupsMarkCall) ValidateArgs() error {
	if len(c.channel) <= 0 {
		return errors.New(`required field channel not initialized`)
	}
	if len(c.timestamp) <= 0 {
		return errors.New(`required field timestamp not initialized`)
	}
	return nil
}
1239505
func (h *syncHandler) Args() bool {
	defer h.mutex.RUnlock()
	h.mutex.RLock()
	return h.handler.Args()
}
777105
func CheckFixedArgs(numArgs int, args []string) error {
	return CheckBoundedArgs(Bounds{Min: numArgs, Max: numArgs}, args)
}
1160920
func (s *SubnetCommandBase) CheckNumArgs(args []string, errors []error) error {
	for num, err := range errors {
		if len(args) == num {
			return err
		}
	}
	return nil
}