// CheckFixedArgs checks that the number of arguments equals numArgs.
777105
func CheckFixedArgs(numArgs int, args []string) error {
	return CheckBoundedArgs(Bounds{Min: numArgs, Max: numArgs}, args)
}
357159
func (v *Function) GetArguments() (o []*Argument) {
	if v != nil {
		o = v.Arguments
	}
	return
}
1201289
func formatArgs(args ...interface{}) []string {
	formatted := make([]string, 0, len(args))
	for _, a := range args {
		s := colorize(pretty.Sprint(a), cyan)
		formatted = append(formatted, s)
	}
	return formatted
}
40839
func (c *UsersSetPresenceCall) ValidateArgs() error {
	if len(c.presence) <= 0 {
		return errors.New(`required field presence not initialized`)
	}
	return nil
}
917788
func ShellQuoteArgs(args []string) string {
	quotedArgs := []string{}
	for _, arg := range args {
		quotedArgs = append(quotedArgs, ShellQuoteArg(arg))
	}
	return strings.Join(quotedArgs, " ")
}
1356563
func (c *agentConf) CheckArgs(args []string) error {
	if c.dataDir == "" {
		return util.RequiredError("data-dir")
	}
	return cmd.CheckEmpty(args)
}
131063
func (c *UsersInfoCall) ValidateArgs() error {
	if len(c.user) <= 0 {
		return errors.New(`required field user not initialized`)
	}
	return nil
}
14173
func parseArgs(funcName string, args ...interface{}) (string, error) {
	if len(args) != 1 {
		return "", fmt.Errorf("invalid arguments to %s.%s -- "+
			"expected database path", dbType, funcName)
	}

	dbPath, ok := args[0].(string)
	if !ok {
		return "", fmt.Errorf("first argument to %s.%s is invalid -- "+
			"expected database path string", dbType, funcName)
	}

	return dbPath, nil
}
1229782
func (c *configCommand) handleArgs(args []string) error {
	if err := c.parseSetKeys(args); err != nil {
		return errors.Trace(err)
	}
	for _, arg := range args {
		// We may have a config.yaml file.
		_, err := os.Stat(arg)
		if err != nil && !strings.Contains(arg, "=") {
			return errors.New("can only retrieve a single value, or all values")
		}
	}
	return nil
}
1242728
func (c *Composer) AddArg(arg interface{}) {
	c.arguments = append(c.arguments, arg)
}
658352
func (p *StringParam) Args() []string {
	return []string{fmt.Sprintf("--%v", p.CLIName()), p.String()}
}
226691
func (p *BoolParam) Args() []string {
	return []string{fmt.Sprintf("--%v", p.CLIName()), p.String()}
}
412243
func (r *PropResult) WithArgs(args []*PropArg) *PropResult {
	r.Args = args
	return r
}
1004033
func checkMultiArg(v reflect.Value) (m multiArgType, elemType reflect.Type) {
	if v.Kind() != reflect.Slice {
		return multiArgTypeInvalid, nil
	}
	elemType = v.Type().Elem()
	switch elemType.Kind() {
	case reflect.Struct:
		return multiArgTypeStruct, elemType
	case reflect.Ptr:
		elemType = elemType.Elem()
		if elemType.Kind() == reflect.Struct {
			return multiArgTypeStructPtr, elemType
		}
	}
	return multiArgTypeInvalid, 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
}
113606
func (d *Dispenser) RemainingArgs() []string {
	var args []string

	for d.NextArg() {
		if d.Val() == "{" {
			d.cursor--
			break
		}
		args = append(args, d.Val())
	}

	return args
}
195015
func ParseArgs(c *model.CommandConfig, parser *flags.Parser, args []string) (err error) {
	var extraArgs []string
	if ini := flag.String("ini", "none", ""); *ini != "none" {
		if err = flags.NewIniParser(parser).ParseFile(*ini); err != nil {
			return
		}
	} else {
		if extraArgs, err = parser.ParseArgs(args); err != nil {
			return
		} else {
			switch parser.Active.Name {
			case "new":
				c.Index = model.NEW
			case "run":
				c.Index = model.RUN
			case "build":
				c.Index = model.BUILD
			case "package":
				c.Index = model.PACKAGE
			case "clean":
				c.Index = model.CLEAN
			case "test":
				c.Index = model.TEST
			case "version":
				c.Index = model.VERSION
			}
		}
	}

	if len(extraArgs) > 0 {
		utils.Logger.Info("Found additional arguements, setting them")
		if !Commands[c.Index].UpdateConfig(c, extraArgs) {
			buffer := &bytes.Buffer{}
			parser.WriteHelp(buffer)
			err = fmt.Errorf("Invalid command line arguements %v\n%s", extraArgs, buffer.String())
		}
	}

	return
}