// Set validates if needed the input value and adds it to the
// internal slice.
2949
func (opts *ListOpts) Set(value string) error {
	if opts.validator != nil {
		v, err := opts.validator(value)
		if err != nil {
			return err
		}
		value = v
	}
	*opts.values = append(*opts.values, value)
	return nil
}
43580
func (u *UintValue) Set(v string) error {
	if u.v == nil {
		u.v = new(uint)
	}
	parsed, err := strconv.ParseUint(v, 0, 64)
	*(u.v) = (uint)(parsed)
	return err
}
98807
func (sa *StringsValue) Set(s string) error {
	*sa = append(*sa, s)
	return nil
}
1339791
func (opts *MapOptions) Set(value string) error {
	if opts.validator != nil {
		v, err := opts.validator(value)
		if err != nil {
			return err
		}
		value = v
	}
	vals := strings.SplitN(value, "=", 2)
	if len(vals) == 1 {
		(opts.vals)[vals[0]] = ""
	} else {
		(opts.vals)[vals[0]] = vals[1]
	}
	return nil
}
938243
func (s *StringValue) Set(v string) error {
	if s.v == nil {
		s.v = new(string)
	}
	*(s.v) = v
	return nil
}
1260577
func (h *Handle) Set(ordinal uint64) error {
	if err := h.validateOrdinal(ordinal); err != nil {
		return err
	}
	_, err := h.set(ordinal, 0, 0, false, false, false)
	return err
}
495252
func (s *StreamName) Set(value string) error {
	v := StreamName(value)
	if err := v.Validate(); err != nil {
		return err
	}
	*s = v
	return nil
}
6653
func (p *IntParam) Set(s string) error {
	v, err := strconv.ParseInt(s, 0, 64)
	if err != nil {
		return err
	}
	p.val = &v
	return nil
}
1233334
func (f *Flag) Set(val string) error {
	if val == "" {
		return fmt.Errorf("must have an argument value")
	}

	if f.Data == nil {
		f.Data = stringset.NewFromSlice(val)
	} else {
		f.Data.Add(val)
	}
	return nil
}
1262925
func (tags *tagList) Set(value string) error {
	err := common.ValidateInstanceTag(value)
	if err != nil {
		return commandLineError{err}
	}
	*tags = append(*tags, value)
	return nil
}
899110
func (j *Json) Set(key string, val interface{}) {
	m, err := j.Map()
	if err != nil {
		return
	}
	m[key] = val
}
724008
func (f *boolSliceFlag) Set(val string) error {
	b, err := strconv.ParseBool(val)
	if err != nil {
		return errors.Reason("values must be booleans").Err()
	}
	*f = append(*f, b)
	return nil
}
1109661
func (r *Range) Set(value string) error {
	newRange, err := ParseRange(value)
	if err != nil {
		return err
	}
	*r = *newRange
	return nil
}
1214693
func (d *Duration) Set(s string) error {
	if v, err := strconv.ParseInt(s, 10, 64); err == nil {
		*d = Duration(time.Duration(v) * time.Second)
		return nil
	}

	v, err := time.ParseDuration(s)
	*d = Duration(v)
	return err
}
538931
func (me *Int) Set(s string) {
	v, _ := strconv.ParseInt(s, 0, 32)
	*me = Int(v)
}
208787
func (i *Int8) Set(value int8) {
	i.lock.Lock()
	defer i.lock.Unlock()
	i.increment = value
}
297233
func (m *ColonSeparatedMultimapStringString) Set(value string) error {
	if m.Multimap == nil {
		return fmt.Errorf("no target (nil pointer to map[string][]string)")
	}
	if !m.initialized || *m.Multimap == nil {
		// clear default values, or allocate if no existing map
		*m.Multimap = make(map[string][]string)
		m.initialized = true
	}
	for _, pair := range strings.Split(value, ",") {
		if len(pair) == 0 {
			continue
		}
		kv := strings.SplitN(pair, ":", 2)
		if len(kv) != 2 {
			return fmt.Errorf("malformed pair, expect string:string")
		}
		k := strings.TrimSpace(kv[0])
		v := strings.TrimSpace(kv[1])
		(*m.Multimap)[k] = append((*m.Multimap)[k], v)
	}
	return nil
}