// BuildArgs returns an array of Python interpreter arguments for cl.
187046
func (cl *CommandLine) BuildArgs() []string {
	targetArgs := cl.Target.buildArgsForTarget()
	args := make([]string, 0, len(cl.Flags)+1+len(targetArgs)+len(cl.Args))
	for _, flag := range cl.Flags {
		args = append(args, flag.String())
	}

	var flagSeparator []string
	if cl.FlagSeparator {
		flagSeparator = []string{"--"}
	}

	// If our target is specified as a flag, we need to emit it before the flag
	// separator. If our target is specified as a positional argument (e.g.,
	// CommandTarget), we can emit it on either side.
	if !cl.Target.followsFlagSeparator() {
		args = append(args, targetArgs...)
		args = append(args, flagSeparator...)
	} else {
		args = append(args, flagSeparator...)
		args = append(args, targetArgs...)
	}

	args = append(args, cl.Args...)
	return args
}
1160775
func expandArgs(args []string, resolveTarget func(string) (*resolvedTarget, error)) (
	[]string, []*resolvedTarget, error,
) {
	outArgs := make([]string, len(args))
	var targets []*resolvedTarget
	for i, arg := range args {
		v := strings.SplitN(arg, ":", 2)
		if strings.HasPrefix(arg, "-") || len(v) <= 1 {
			// Can't be an interesting target, so just pass it along
			outArgs[i] = arg
			continue
		}

		target, err := resolveTarget(v[0])
		if err != nil {
			return nil, nil, err
		}
		arg := net.JoinHostPort(target.host, v[1])
		if target.user != "" {
			arg = target.user + "@" + arg
		}
		outArgs[i] = arg

		targets = append(targets, target)
	}
	return outArgs, targets, nil
}
314933
func (po *PageOptions) Args() []string {
	return append(append([]string{}, po.pageOptions.Args()...), po.headerAndFooterOptions.Args()...)
}
466811
func NewBuildArgs(argsFromOptions map[string]*string) *BuildArgs {
	return &BuildArgs{
		allowedBuildArgs: make(map[string]*string),
		allowedMetaArgs:  make(map[string]*string),
		referencedArgs:   make(map[string]struct{}),
		argsFromOptions:  argsFromOptions,
	}
}
1332667
func Build(grammar interface{}, options ...Option) (parser *Parser, err error) {
	// Configure Parser struct with defaults + options.
	p := &Parser{
		lex:             lexer.TextScannerLexer,
		caseInsensitive: map[string]bool{},
		useLookahead:    1,
	}
	for _, option := range options {
		if option == nil {
			return nil, fmt.Errorf("nil Option passed, signature has changed; " +
				"if you intended to provide a custom Lexer, try participle.Build(grammar, participle.Lexer(lexer))")
		}
		if err = option(p); err != nil {
			return nil, err
		}
	}

	if len(p.mappers) > 0 {
		mappers := map[rune][]Mapper{}
		symbols := p.lex.Symbols()
		for _, mapper := range p.mappers {
			if len(mapper.symbols) == 0 {
				mappers[lexer.EOF] = append(mappers[lexer.EOF], mapper.mapper)
			} else {
				for _, symbol := range mapper.symbols {
					if rn, ok := symbols[symbol]; !ok {
						return nil, fmt.Errorf("mapper %#v uses unknown token %q", mapper, symbol)
					} else { // nolint: golint
						mappers[rn] = append(mappers[rn], mapper.mapper)
					}
				}
			}
		}
		p.lex = &mappingLexerDef{p.lex, func(t lexer.Token) (lexer.Token, error) {
			combined := make([]Mapper, 0, len(mappers[t.Type])+len(mappers[lexer.EOF]))
			combined = append(combined, mappers[lexer.EOF]...)
			combined = append(combined, mappers[t.Type]...)

			var err error
			for _, m := range combined {
				t, err = m(t)
				if err != nil {
					return t, err
				}
			}
			return t, nil
		}}
	}

	context := newGeneratorContext(p.lex)
	v := reflect.ValueOf(grammar)
	if v.Kind() == reflect.Interface {
		v = v.Elem()
	}
	p.typ = v.Type()
	p.root, err = context.parseType(p.typ)
	if err != nil {
		return nil, err
	}
	return p, nil
}
251294
func updateBuildArgs(oldArgs *[]corev1.EnvVar, newArgs []corev1.EnvVar) []corev1.EnvVar {
	combined := make(map[string]string)

	// Change oldArgs into a map
	for _, o := range *oldArgs {
		combined[o.Name] = o.Value
	}

	// Add new args, this overwrites old
	for _, n := range newArgs {
		combined[n.Name] = n.Value
	}

	// Change back into an array
	var result []corev1.EnvVar
	for k, v := range combined {
		result = append(result, corev1.EnvVar{Name: k, Value: v})
	}

	return result
}
1147311
func (c *container) createArgs(cmds []string) []string {
	adHoc := (len(cmds) > 0)
	args := []string{}
	// AddHost
	for _, addHost := range c.AddHost() {
		args = append(args, "--add-host", addHost)
	}
	// BlkioWeight
	if c.BlkioWeight > 0 {
		args = append(args, "--blkio-weight", strconv.Itoa(c.BlkioWeight))
	}
	// BlkioWeightDevice
	for _, blkioWeightDevice := range c.BlkioWeightDevice() {
		args = append(args, "--blkio-weight-device", blkioWeightDevice)
	}
	// CapAdd
	for _, capAdd := range c.CapAdd() {
		args = append(args, "--cap-add", capAdd)
	}
	// CapDrop
	for _, capDrop := range c.CapDrop() {
		args = append(args, "--cap-drop", capDrop)
	}
	// CgroupParent
	if len(c.CgroupParent()) > 0 {
		args = append(args, "--cgroup-parent", c.CgroupParent())
	}
	// Cidfile
	if len(c.Cidfile()) > 0 {
		args = append(args, "--cidfile", c.Cidfile())
	}
	// CPUPeriod
	if c.CPUPeriod > 0 {
		args = append(args, "--cpu-period", strconv.Itoa(c.CPUPeriod))
	}
	// CPUQuota
	if c.CPUQuota > 0 {
		args = append(args, "--cpu-quota", strconv.Itoa(c.CPUQuota))
	}
	// CPU set
	if c.CPUset > 0 {
		args = append(args, "--cpuset", strconv.Itoa(c.CPUset))
	}
	// CPU shares
	if c.CPUShares > 0 {
		args = append(args, "--cpu-shares", strconv.Itoa(c.CPUShares))
	}
	// Device
	for _, device := range c.Device() {
		args = append(args, "--device", device)
	}
	// DeviceReadBps
	for _, deviceReadBps := range c.DeviceReadBps() {
		args = append(args, "--device-read-bps", deviceReadBps)
	}
	// DeviceReadIops
	for _, deviceReadIops := range c.DeviceReadIops() {
		args = append(args, "--device-read-iops", deviceReadIops)
	}
	// DeviceWriteBps
	for _, deviceWriteBps := range c.DeviceWriteBps() {
		args = append(args, "--device-write-bps", deviceWriteBps)
	}
	// DeviceWriteIops
	for _, deviceWriteIops := range c.DeviceWriteIops() {
		args = append(args, "--device-write-iops", deviceWriteIops)
	}
	// DNS
	for _, dns := range c.DNS() {
		args = append(args, "--dns", dns)
	}

	// DNSOpt
	for _, dnsOpt := range c.DNSOpt() {
		args = append(args, "--dns-opt", dnsOpt)
	}
	// DNS Search
	for _, dnsSearch := range c.DNSSearch() {
		args = append(args, "--dns-search", dnsSearch)
	}
	// Entrypoint
	if len(c.Entrypoint()) > 0 {
		args = append(args, "--entrypoint", c.Entrypoint())
	}
	// Env
	for _, env := range c.Env() {
		args = append(args, "--env", env)
	}
	// Env file
	for _, envFile := range c.EnvFile() {
		args = append(args, "--env-file", envFile)
	}
	// Expose
	for _, expose := range c.Expose() {
		args = append(args, "--expose", expose)
	}
	// GroupAdd
	for _, groupAdd := range c.GroupAdd() {
		args = append(args, "--group-add", groupAdd)
	}
	// Health Cmd
	if len(c.HealthCmd()) > 0 {
		args = append(args, "--health-cmd", c.HealthCmd())
	}
	// Health Interval
	if len(c.HealthInterval()) > 0 {
		args = append(args, "--health-interval", c.HealthInterval())
	}
	// Health Retries
	if c.HealthRetries > 0 {
		args = append(args, "--health-retries", strconv.Itoa(c.HealthRetries))
	} else if c.HealthcheckParams().Retries > 0 {
		args = append(args, "--health-retries", strconv.Itoa(c.HealthcheckParams().Retries))
	}
	// Health Timeout
	if len(c.HealthTimeout()) > 0 {
		args = append(args, "--health-timeout", c.HealthTimeout())
	}
	// Host
	if len(c.Hostname()) > 0 {
		args = append(args, "--hostname", c.Hostname())
	}
	// Init
	if c.Init {
		args = append(args, "--init")
	}
	// Interactive
	if c.Stdin_Open || c.Interactive {
		args = append(args, "--interactive")
	}
	// Ip
	if !adHoc {
		if len(c.Ip()) > 0 {
			args = append(args, "--ip", c.Ip())
		}
	}
	// Ip6
	if !adHoc {
		if len(c.Ip6()) > 0 {
			args = append(args, "--ip6", c.Ip6())
		}
	}
	// IPC
	if len(c.IPC()) > 0 {
		ipcContainer := containerReference(c.IPC())
		if len(ipcContainer) > 0 {
			if includes(allowed, ipcContainer) {
				args = append(args, "--ipc", "container:"+cfg.Container(ipcContainer).ActualName(false))
			}
		} else {
			args = append(args, "--ipc", c.IPC())
		}
	}
	// Isolation
	if len(c.Isolation()) > 0 {
		args = append(args, "--isolation", c.Isolation())
	}
	// KernelMemory
	if len(c.KernelMemory()) > 0 {
		args = append(args, "--kernel-memory", c.KernelMemory())
	}
	// Label
	for _, label := range c.Label() {
		args = append(args, "--label", label)
	}
	// LabelFile
	for _, labelFile := range c.LabelFile() {
		args = append(args, "--label-file", labelFile)
	}
	// Link
	for _, link := range c.Link() {
		linkParts := strings.Split(link, ":")
		linkName := linkParts[0]
		if includes(allowed, linkName) {
			linkParts[0] = cfg.Container(linkName).ActualName(false)
			args = append(args, "--link", strings.Join(linkParts, ":"))
		}
	}
	// External Links
	for _, externalLink := range c.ExternalLinks() {
		args = append(args, "--link", externalLink)
	}
	// LogDriver
	if len(c.LogDriver()) > 0 {
		args = append(args, "--log-driver", c.LogDriver())
	}
	// LogOpt
	for _, opt := range c.LogOpt() {
		args = append(args, "--log-opt", opt)
	}
	// LxcConf
	for _, lxcConf := range c.LxcConf() {
		args = append(args, "--lxc-conf", lxcConf)
	}
	// Mac address
	if len(c.MacAddress()) > 0 {
		args = append(args, "--mac-address", c.MacAddress())
	}
	// Memory
	if len(c.Memory()) > 0 {
		args = append(args, "--memory", c.Memory())
	}
	// MemoryReservation
	if len(c.MemoryReservation()) > 0 {
		args = append(args, "--memory-reservation", c.MemoryReservation())
	}
	// MemorySwap
	if len(c.MemorySwap()) > 0 {
		args = append(args, "--memory-swap", c.MemorySwap())
	}
	// MemorySwappiness
	if c.MemorySwappiness.Defined {
		args = append(args, "--memory-swappiness", strconv.Itoa(c.MemorySwappiness.Value))
	}
	// Net
	netParam := c.ActualNet()
	if len(netParam) > 0 && netParam != netBridge {
		args = append(args, "--net", netParam)
	}
	// NetAlias
	for _, netAlias := range c.NetAlias() {
		args = append(args, "--net-alias", netAlias)
	}
	// NoHealthcheck
	if c.NoHealthcheck || c.HealthcheckParams().Disable {
		args = append(args, "--no-healthcheck")
	}
	// OomKillDisable
	if c.OomKillDisable {
		args = append(args, "--oom-kill-disable")
	}
	// OomScoreAdj
	if len(c.OomScoreAdj()) > 0 {
		args = append(args, "--oom-score-adj", c.OomScoreAdj())
	}
	// PID
	if len(c.Pid()) > 0 {
		args = append(args, "--pid", c.Pid())
	}
	// Privileged
	if c.Privileged {
		args = append(args, "--privileged")
	}
	// Publish
	if !adHoc {
		for _, port := range c.Publish() {
			args = append(args, "--publish", port)
		}
	}
	// PublishAll
	if !adHoc {
		if c.PublishAll {
			args = append(args, "--publish-all")
		}
	}
	// ReadOnly
	if c.ReadOnly || c.Read_Only {
		args = append(args, "--read-only")
	}
	// Restart
	if len(c.Restart()) > 0 {
		args = append(args, "--restart", c.Restart())
	}
	// Rm
	if adHoc || c.RawRm {
		args = append(args, "--rm")
	}
	// SecurityOpt
	for _, securityOpt := range c.SecurityOpt() {
		args = append(args, "--security-opt", securityOpt)
	}
	// Share SSH socket
	if c.ShareSshSocket {
		sock_path := os.Getenv("SSH_AUTH_SOCK")
		args = append(args, "--volume", sock_path+":/ssh-socket")
		args = append(args, "--env", "SSH_AUTH_SOCK=/ssh-socket")
	}
	// ShmSize
	if len(c.ShmSize()) > 0 {
		args = append(args, "--shm-size", c.ShmSize())
	}
	// SigProxy
	if c.SigProxy.Falsy() {
		args = append(args, "--sig-proxy=false")
	}
	// StopSignal
	if len(c.StopSignal()) > 0 {
		args = append(args, "--stop-signal", c.StopSignal())
	}
	// StopTimeout
	if len(c.StopTimeout()) > 0 {
		args = append(args, "--stop-timeout", c.StopTimeout())
	}
	// Tmpfs
	for _, tmpfs := range c.Tmpfs() {
		args = append(args, "--tmpfs", tmpfs)
	}
	// Tty
	if c.Tty {
		args = append(args, "--tty")
	}
	// Ulimit
	for _, ulimit := range c.Ulimit() {
		args = append(args, "--ulimit", ulimit)
	}
	// User
	if len(c.User()) > 0 {
		args = append(args, "--user", c.User())
	}
	// Userns
	if len(c.Userns()) > 0 {
		args = append(args, "--userns", c.Userns())
	}
	// Uts
	if len(c.Uts()) > 0 {
		args = append(args, "--uts", c.Uts())
	}
	// Volumes
	for _, volume := range c.Volume() {
		volumeArgs := []string{"--volume"}
		am := cfg.AcceleratedMount(volume)
		if accelerationEnabled() && am != nil {
			am.Run()
			volumeArgs = append(volumeArgs, am.VolumeArg())
		} else {
			volumeArgs = append(volumeArgs, actualVolumeArg(volume))
		}
		args = append(args, volumeArgs...)
	}
	// VolumeDriver
	if len(c.VolumeDriver()) > 0 {
		args = append(args, "--volume-driver", c.VolumeDriver())
	}
	// VolumesFrom
	for _, volumesFrom := range c.VolumesFrom() {
		volumesFromParts := strings.Split(volumesFrom, ":")
		volumesFromName := volumesFromParts[0]
		if includes(allowed, volumesFromName) {
			volumesFromParts[0] = cfg.Container(volumesFromName).ActualName(false)
			args = append(args, "--volumes-from", strings.Join(volumesFromParts, ":"))
		}
	}
	// Workdir
	if len(c.Workdir()) > 0 {
		args = append(args, "--workdir", c.Workdir())
	}
	// Name
	args = append(args, "--name", c.ActualName(adHoc))
	// Image
	args = append(args, c.Image())
	// Command
	if len(cmds) > 0 {
		args = append(args, cmds...)
	} else {
		args = append(args, c.Cmd()...)
	}
	return args
}
862057
func (p *KVParam) Args() []string {
	if len(p.values) == 0 {
		return []string{}
	}
	vals := make([]string, len(p.values))
	for i, v := range p.values {
		vals[i] = v.String()
	}
	return []string{
		fmt.Sprintf("--%v", p.CLIName()), strings.Join(vals, p.sep())}
}
754873
func (s *CodeGenNode) SetArgs(v []*CodeGenNodeArg) *CodeGenNode {
	s.Args = v
	return s
}
977389
func (s *ScriptBootstrapActionConfig) SetArgs(v []*string) *ScriptBootstrapActionConfig {
	s.Args = v
	return s
}
494992
func (me *SqlBuilder) WriteArg(i interface{}) {
	me.CurrentArgPosition++
	me.args = append(me.args, i)
}
664296
func (s *SupportedProductConfig) SetArgs(v []*string) *SupportedProductConfig {
	s.Args = v
	return s
}
407397
func (s *SVG) WriteArgs(args map[string]interface{}) string {
	str := ""

	for k, v := range args {
		objType := fmt.Sprintf("%s", reflect.TypeOf(v))

		switch objType {
		case "string":
			str += fmt.Sprintf("%s='%s' ", k, v)
		case "int":
			str += fmt.Sprintf("%s='%v' ", k, v)
		case "float64":
			str += fmt.Sprintf("%s='%v' ", k, v)
		default:
			{
				str += fmt.Sprintf("%s='", k)
				for K, V := range v.(map[string]string) {
					str += fmt.Sprintf("%s:%s;", K, V)
				}
				str += "' "
			}
		}
	}

	return str
}
195552
func escapeArgs(args []string) string {
	escapedArgs := make([]string, len(args))
	for i, a := range args {
		escapedArgs[i] = windows.EscapeArg(a)
	}
	return strings.Join(escapedArgs, " ")
}
250907
func processArgs() (cfg *etcd.ClientConfig, op int, data []string, err error) {
	var task []string

	// default args
	fileConfig := &etcd.Config{}
	op = Put

	if len(os.Args) > 2 {
		if os.Args[1] == "--cfg" {
			err = config.ParseConfigFromYamlFile(os.Args[2], fileConfig)
			if err != nil {
				return
			}
			cfg, err = etcd.ConfigToClient(fileConfig)
			if err != nil {
				return
			}

			task = os.Args[3:]
		} else {
			task = os.Args[1:]
		}
	} else {
		return cfg, 0, nil, fmt.Errorf("incorrect arguments")
	}

	if len(task) < 2 || (task[0] == "put" && len(task) < 4) {
		return cfg, 0, nil, fmt.Errorf("incorrect arguments")
	}

	if task[0] == "delete" {
		op = Delete
	} else if task[0] == "puttxn" {
		op = PutTxn
	}

	return cfg, op, task[1:], nil
}
1126853
func (p *ListParam) Args() []string {
	if len(p.values) == 0 {
		return []string{}
	}
	out := make([]string, 0, len(p.values))
	for _, v := range p.values {
		out = append(out, v.Args()...)
	}
	return out
}
618964
func NewArgs(initialArgs ...KeyValuePair) Args {
	args := Args{fields: map[string]map[string]bool{}}
	for _, arg := range initialArgs {
		args.Add(arg.Key, arg.Value)
	}
	return args
}