// GetArgs returns all the arguments that were given to the currnetly
// called function (currently on the stack).
339148
func (m *Mrb) GetArgs() []*MrbValue {
	getArgLock.Lock()
	defer getArgLock.Unlock()

	// Clear reset the accumulator to zero length
	getArgAccumulator = make([]C.mrb_value, 0, C._go_get_max_funcall_args())

	// Get all the arguments and put it into our accumulator
	count := C._go_mrb_get_args_all(m.state)

	// Convert those all to values
	values := make([]*MrbValue, count)

	for i := 0; i < int(count); i++ {
		values[i] = newValue(m.state, getArgAccumulator[i])
	}

	return values
}
226691
func (p *BoolParam) Args() []string {
	return []string{fmt.Sprintf("--%v", p.CLIName()), p.String()}
}
246482
func (a *argGroup) GetArg(name string) *ArgClause {
	for _, arg := range a.args {
		if arg.name == name {
			return arg
		}
	}
	return nil
}
907896
func (c *configCommand) handleArgs(args []string) error {
	// This must be setting values but let's make sure.
	var pairs, numArgs int
	numArgs = len(args)
	for _, a := range args {
		if strings.Contains(a, "=") {
			pairs++
		}
	}
	if pairs == numArgs {
		return c.parseSet(args)
	}
	if pairs == 0 {
		return errors.New("can only retrieve a single value, or all values")
	}
	return errors.New("cannot set and retrieve values simultaneously")
}
31729
func (s *Command) SetArgs(v []*string) *Command {
	s.Args = v
	return s
}
17668
func getArgumentValues(
	argDefs []*Argument, argASTs []*ast.Argument,
	variableValues map[string]interface{}) map[string]interface{} {

	argASTMap := map[string]*ast.Argument{}
	for _, argAST := range argASTs {
		if argAST.Name != nil {
			argASTMap[argAST.Name.Value] = argAST
		}
	}
	results := map[string]interface{}{}
	for _, argDef := range argDefs {
		var (
			tmp   interface{}
			value ast.Value
		)
		if tmpValue, ok := argASTMap[argDef.PrivateName]; ok {
			value = tmpValue.Value
		}
		if tmp = valueFromAST(value, argDef.Type, variableValues); isNullish(tmp) {
			tmp = argDef.DefaultValue
		}
		if !isNullish(tmp) {
			results[argDef.PrivateName] = tmp
		}
	}
	return results
}
740711
func globGetArgs(args []string) globArgs {
	f, target := standardFlags(globCmd)
	suffix := f.String("suffix", "", "File suffix (example: .go)")
	globbingMode := f.String("glob-mode", "all", "Which files to glob (normal, dot-files, all [default])")
	filelist := f.String("filelist", "", "Read all the files from this file")
	var mapTo []string
	mapToWrapper := common.StringSliceWrapper{Slice: &mapTo}
	f.Var(&mapToWrapper, "map-to", "Map contents of filelist to this directory, can be used multiple times")

	f.Parse(args)
	if *target == "" {
		common.Die("--target parameter must be specified and cannot be empty")
	}
	mode := globModeFromString(*globbingMode)
	if *filelist == "" {
		common.Die("--filelist parameter must be specified and cannot be empty")
	}
	if len(mapTo) < 1 {
		common.Die("--map-to parameter must be specified at least once")
	}
	return globArgs{
		target:   *target,
		suffix:   *suffix,
		mode:     mode,
		filelist: *filelist,
		mapTo:    mapTo,
	}
}
1315850
func (b *BuildArgs) AddArg(key string, value *string) {
	b.allowedBuildArgs[key] = value
	b.referencedArgs[key] = struct{}{}
}
447957
func bindArgs(names []string, arg interface{}, m *reflectx.Mapper) ([]interface{}, error) {
	arglist := make([]interface{}, 0, len(names))

	// grab the indirected value of arg
	v := reflect.ValueOf(arg)
	for v = reflect.ValueOf(arg); v.Kind() == reflect.Ptr; {
		v = v.Elem()
	}

	err := m.TraversalsByNameFunc(v.Type(), names, func(i int, t []int) error {
		if len(t) == 0 {
			return fmt.Errorf("could not find name %s in %#v", names[i], arg)
		}

		val := reflectx.FieldByIndexesReadOnly(v, t)
		arglist = append(arglist, val.Interface())

		return nil
	})

	return arglist, err
}
18607
func (e *Error) GenByArgs(args ...interface{}) *Error {
	err := *e
	err.args = args
	_, err.file, err.line, _ = runtime.Caller(1)
	return &err
}
565953
func (args Args) Get(key string) []string {
	values := args.fields[key]
	if values == nil {
		return make([]string, 0)
	}
	slice := make([]string, 0, len(values))
	for key := range values {
		slice = append(slice, key)
	}
	return slice
}
316761
func GetGlobArgs(args []string) ([]string, error) {

	var a []string

	for _, v := range args {
		files, err := filepath.Glob(v)
		if err != nil {
			return nil, err
		}
		a = append(a, files...)
	}

	return a, nil
}
287062
func (ctx *Context) GetArgvList(curr interface{}, parents ...interface{}) error {
	if isEmptyArgvList(ctx.argvList) {
		return argvError{isEmpty: true}
	}
	for i, argv := range append([]interface{}{curr}, parents...) {
		if argv == nil {
			continue
		}
		if i >= len(ctx.argvList) {
			return argvError{isOutOfRange: true}
		}
		if ctx.argvList[i] == nil {
			return argvError{ith: i, msg: "source is nil"}
		}

		buf := bytes.NewBufferString("")
		if err := json.NewEncoder(buf).Encode(ctx.argvList[i]); err != nil {
			return err
		}
		if err := json.NewDecoder(buf).Decode(argv); err != nil {
			return err
		}
	}
	return 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
}
357159
func (v *Function) GetArguments() (o []*Argument) {
	if v != nil {
		o = v.Arguments
	}
	return
}
1316164
func (launcher *Launcher) SetArgs(args []string) {
	launcher.Mutex.Lock()
	launcher.args = args
	launcher.Mutex.Unlock()
}
1352540
func missingArg(o Option) *Error {
	return &Error{
		ErrorCode: MissingParameter,
		Name:      o.Name(),
		Err:       fmt.Errorf("missing parameter for %s", o.Name()),
	}
}