// ArgsFrom make arguments for command-line flag from configuration file.
9285
func ArgsFrom(conf string, positions ...string) ([]string, error) {
	if _, err := os.Stat(conf); err != nil {
		return nil, err
	}
	return parse(conf, positions...)
}
1261628
func TranslatorFrom(charset string) (Translator, error) {
	var err error
	var tr Translator
	for _, f := range factories {
		tr, err = f.TranslatorFrom(charset)
		if err == nil {
			break
		}
	}
	if tr == nil {
		return nil, err
	}
	return tr, nil
}
507625
func ParseFlagsWithArgs(cmd string) []string {
	flag.Parse()

	if *Version {
		AppVersion.Print()
		os.Exit(0)
	}

	args := flag.Args()
	if len(args) == 0 {
		log.Exitf("%s expected at least one positional argument", 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())}
}
318857
func (f *file) lintContextArgs() {
	f.walk(func(n ast.Node) bool {
		fn, ok := n.(*ast.FuncDecl)
		if !ok || len(fn.Type.Params.List) <= 1 {
			return true
		}
		// A context.Context should be the first parameter of a function.
		// Flag any that show up after the first.
		for _, arg := range fn.Type.Params.List[1:] {
			if isPkgDot(arg.Type, "context", "Context") {
				f.errorf(fn, 0.9, link("https://golang.org/pkg/context/"), category("arg-order"), "context.Context should be the first parameter of a function")
				break // only flag one
			}
		}
		return true
	})
}
294938
func CommandLineToArgv(commandLine string) ([]string, error) {
	var argc int32

	argsPtr, err := windows.UTF16PtrFromString(commandLine)
	if err != nil {
		return nil, err
	}

	argv, err := windows.CommandLineToArgv(argsPtr, &argc)
	if err != nil {
		return nil, err
	}
	defer windows.LocalFree(windows.Handle(uintptr(unsafe.Pointer(argv))))

	newArgs := make([]string, argc)
	for i, v := range (*argv)[:argc] {
		newArgs[i] = string(windows.UTF16ToString((*v)[:]))
	}

	return newArgs, nil
}
486239
func NewTomlSourceFromFlagFunc(flagFileName string) func(context *cli.Context) (InputSourceContext, error) {
	return func(context *cli.Context) (InputSourceContext, error) {
		filePath := context.String(flagFileName)
		return NewTomlSourceFromFile(filePath)
	}
}
116854
func (c *Command) Args() []*Arg {
	ret := make([]*Arg, len(c.args))
	copy(ret, c.args)

	return ret
}
314933
func (po *PageOptions) Args() []string {
	return append(append([]string{}, po.pageOptions.Args()...), po.headerAndFooterOptions.Args()...)
}
718362
func PopFirstArgument(args []string) (string, []string, error) {
	if len(args) < 1 {
		return "", nil, errors.New("not enough arguments are supplied --- please refer to the usage")
	}
	return args[0], args[1:], nil
}
1048704
func Main(params base.Parameters, args []string) int {
	// Enable not-yet-standard Starlark features.
	resolve.AllowLambda = true
	resolve.AllowNestedDef = true
	resolve.AllowFloat = true
	resolve.AllowSet = true

	// A hack to allow '#!/usr/bin/env lucicfg'. On Linux the shebang line can
	// have at most two arguments, so we can't use '#!/usr/bin/env lucicfg gen'.
	if len(args) == 1 {
		if _, err := os.Stat(args[0]); err == nil {
			args = []string{"generate", args[0]}
		}
	}

	return subcommands.Run(GetApplication(params), fixflagpos.FixSubcommands(args))
}
27245
func (sf *scriptFlags) ReadFrom(r io.Reader) (int64, error) {
	var b [8]byte
	n, err := io.ReadFull(r, b[:])
	if err != nil {
		return int64(n), err
	}

	// We match bits from addrFlags for similar fields. hence hasScript uses
	// the same bit as hasPubKey and the change bit is the same for both.
	sf.hasScript = b[0]&(1<<1) != 0
	sf.change = b[0]&(1<<5) != 0
	sf.unsynced = b[0]&(1<<6) != 0
	sf.partialSync = b[0]&(1<<7) != 0

	return int64(n), nil
}
60451
func ArgsArg(r, o int) ArgSpec {
	return ArgSpec(C._go_MRB_ARGS_ARG(C.int(r), C.int(o)))
}
1103324
func ParsePathsFromArgs() {
	flag.Parse()
	for _, dir := range flag.Args() {
		var conf loader.Config
		conf.ParserMode = parser.ParseComments
		conf.ImportWithTests(dir)
		prog, err := conf.Load()
		if err != nil {
			panic(err)
		}

		r := renamer{prog, map[*token.File]bool{}}
		r.parse()
		if !*dryRun {
			r.write()
		}
	}
}
879175
func argName(arg ast.Expr) string {
	name := ""
	switch a := arg.(type) {
	case *ast.Ident:
		if a.Obj.Kind == ast.Var || a.Obj.Kind == ast.Con {
			name = a.Obj.Name
		}
	case *ast.BinaryExpr,
		*ast.CallExpr,
		*ast.IndexExpr,
		*ast.KeyValueExpr,
		*ast.ParenExpr,
		*ast.SelectorExpr,
		*ast.SliceExpr,
		*ast.TypeAssertExpr,
		*ast.UnaryExpr:
		name = exprToString(arg)
	}
	return name
}
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
}
139456
func (fs *FlagSet) Arg(i int) string {
	if i < 0 || i >= len(fs.args) {
		return ""
	}
	return fs.args[i]
}