// parseTags parses all individual tags found within a struct tag.
775847
func (mv *Validator) parseTags(t string) ([]tag, error) {
	tl := strings.Split(t, ",")
	tags := make([]tag, 0, len(tl))
	for _, i := range tl {
		tg := tag{}
		v := strings.SplitN(i, "=", 2)
		tg.Name = strings.Trim(v[0], " ")
		if tg.Name == "" {
			return []tag{}, ErrUnknownTag
		}
		if len(v) > 1 {
			tg.Param = strings.Trim(v[1], " ")
		}
		var found bool
		if tg.Fn, found = mv.validationFuncs[tg.Name]; !found {
			return []tag{}, ErrUnknownTag
		}
		tags = append(tags, tg)

	}
	return tags, nil
}
1314430
func (w *controllerCommandWrapper) SetFlags(f *gnuflag.FlagSet) {
	if w.setControllerFlags {
		f.StringVar(&w.controllerName, "c", "", "Controller to operate in")
		f.StringVar(&w.controllerName, "controller", "", "")
	}
	w.ControllerCommand.SetFlags(f)
}
499161
func parseFieldTags(f reflect.StructField) fieldTags {
	var ret fieldTags

	for i, s := range strings.Split(f.Tag.Get("json"), ",") {
		switch {
		case i == 0 && s == "-":
			ret.omit = true
		case i == 0:
			ret.name = s
		case s == "omitempty":
			ret.omitEmpty = true
		case s == "!omitempty":
			ret.noOmitEmpty = true
		case s == "string":
			ret.asString = true
		case s == "required":
			ret.required = true
		}
	}

	return ret
}
1330819
func (c *dumpCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ModelCommandBase.SetFlags(f)
	c.out.AddFlags(f, "yaml", output.DefaultFormatters)
	f.BoolVar(&c.simplified, "simplified", false, "Dump a simplified partial model")
}
1255179
func ParseTagSliceToMap(tags []string) map[string]string {
	mappedTags := make(map[string]string)
	for _, tag := range tags {
		splt := strings.SplitN(tag, ":", 2)
		if len(splt) < 2 {
			mappedTags[splt[0]] = ""
		} else {
			mappedTags[splt[0]] = splt[1]
		}
	}
	return mappedTags
}
816273
func (c *cancelCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ActionCommandBase.SetFlags(f)
	c.out.AddFlags(f, "yaml", output.DefaultFormatters)
}
1186556
func (c *AddMetricCommand) SetFlags(f *gnuflag.FlagSet) {
	f.StringVar(&c.Labels, "l", "", "labels to be associated with metric values")
	f.StringVar(&c.Labels, "labels", "", "")
}
1321130
func OptSetTags(tags map[string]map[string]string) PluginControlOpt {
	return func(c *pluginControl) {
		c.pluginManager.SetPluginTags(tags)
	}
}
615346
func parseTagFlag(tagFlag string) (tag string, err error) {
	tags := strings.Fields(tagFlag)
	if len(tags) != 1 {
		return "", fmt.Errorf("%q is not a valid single build tag, but %q", tagFlag, tags)
	}
	return tags[0], nil
}
995309
func (c *addImageMetadataCommand) SetFlags(f *gnuflag.FlagSet) {
	c.cloudImageMetadataCommandBase.SetFlags(f)

	f.StringVar(&c.Region, "region", "", "image cloud region")
	f.StringVar(&c.Series, "series", "", "image series")
	f.StringVar(&c.Arch, "arch", "amd64", "image architecture")
	f.StringVar(&c.VirtType, "virt-type", "", "image metadata virtualisation type")
	f.StringVar(&c.RootStorageType, "storage-type", "", "image metadata root storage type")
	f.Uint64Var(&c.RootStorageSize, "storage-size", 0, "image metadata root storage size")
	f.StringVar(&c.Stream, "stream", "released", "image metadata stream")
}
520747
func (s *ChangeTagsForResourceInput) SetAddTags(v []*Tag) *ChangeTagsForResourceInput {
	s.AddTags = v
	return s
}
853528
func (c *branchCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ModelCommandBase.SetFlags(f)
}
506571
func parseTag(s string) (prefix, tag string, err error) {
	splitString := strings.Split(s, ":")
	if len(splitString) == 1 {
		prefix = splitString[0]
	} else if len(splitString) == 2 {
		prefix, tag = splitString[0], splitString[1]
	} else {
		// Unlikely edge case but it doesn't hurt to test for it.
		return "", "", fmt.Errorf("Path should not contain more than one colon: %q", s)
	}

	if strings.HasSuffix(prefix, "/") {
		return "", "", fmt.Errorf(`Image name must not have a trailing "/": %s`, prefix)
	}

	return prefix, tag, nil
}
664504
func matchesAsgTags(tags map[string]string, actual []*autoscaling.TagDescription) bool {
	for k, v := range tags {
		found := false
		for _, a := range actual {
			if aws.StringValue(a.Key) == k {
				if aws.StringValue(a.Value) == v {
					found = true
					break
				}
			}
		}
		if !found {
			return false
		}
	}
	return true
}
468451
func (c *ListCommand) SetFlags(f *gnuflag.FlagSet) {
	c.SubnetCommandBase.SetFlags(f)
	c.Out.AddFlags(f, "yaml", output.DefaultFormatters)

	f.StringVar(&c.SpaceName, "space", "", "Filter results by space name")
	f.StringVar(&c.ZoneName, "zone", "", "Filter results by zone name")
}
43958
func (c *showOutputCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ActionCommandBase.SetFlags(f)
	c.out.AddFlags(f, "yaml", output.DefaultFormatters)
	f.StringVar(&c.wait, "wait", "-1s", "Wait for results")
}
810752
func (c *showCommand) SetFlags(f *gnuflag.FlagSet) {
	c.StorageCommandBase.SetFlags(f)
	c.out.AddFlags(f, "yaml", output.DefaultFormatters)
}