agent/app/args/flag.go
func New(arguments []string) (*Args, error) {
	flagset := flag.NewFlagSet("Amazon ECS Agent", flag.ContinueOnError)

	args := &Args{
		Version:              flagset.Bool(versionFlagName, false, versionUsage),
		LogLevel:             flagset.String(logLevelFlagName, "", logLevelUsage),
		AcceptInsecureCert:   flagset.Bool(acceptInsecureCertFlagName, false, acceptInsecureCertUsage),
		License:              flagset.Bool(licenseFlagName, false, licenseUsage),
		BlackholeEC2Metadata: flagset.Bool(blackholeEC2MetadataFlagName, false, blacholeEC2MetadataUsage),
		ECSAttributes:        flagset.Bool(ecsAttributesFlagName, false, ecsAttributesUsage),
		WindowsService:       flagset.Bool(windowsServiceFlagName, false, windowsServiceUsage),
	}

	err := flagset.Parse(arguments)
	if err != nil {
		return nil, err
	}

	return args, nil
}
func New(arguments []string) (*Args, error) {
	flagset := flag.NewFlagSet("Amazon ECS Agent", flag.ContinueOnError)

	args := &Args{
		Version:              flagset.Bool(versionFlagName, false, versionUsage),
		LogLevel:             flagset.String(logLevelFlagName, "", logLevelUsage),
		AcceptInsecureCert:   flagset.Bool(acceptInsecureCertFlagName, false, acceptInsecureCertUsage),
		License:              flagset.Bool(licenseFlagName, false, licenseUsage),
		BlackholeEC2Metadata: flagset.Bool(blackholeEC2MetadataFlagName, false, blacholeEC2MetadataUsage),
		ECSAttributes:        flagset.Bool(ecsAttributesFlagName, false, ecsAttributesUsage),
		WindowsService:       flagset.Bool(windowsServiceFlagName, false, windowsServiceUsage),
	}

	err := flagset.Parse(arguments)
	if err != nil {
		return nil, err
	}

	return args, nil
}
func New ( arguments [ ] string ) ( * Args , error ) { flagset := flag . NewFlagSet ( " " , flag . ContinueOnError ) args := & Args { Version : flagset . Bool ( versionFlagName , false , versionUsage ) , LogLevel : flagset . String ( logLevelFlagName , " " , logLevelUsage ) , AcceptInsecureCert : flagset . Bool ( acceptInsecureCertFlagName , false , acceptInsecureCertUsage ) , License : flagset . Bool ( licenseFlagName , false , licenseUsage ) , BlackholeEC2Metadata : flagset . Bool ( blackholeEC2MetadataFlagName , false , blacholeEC2MetadataUsage ) , ECSAttributes : flagset . Bool ( ecsAttributesFlagName , false , ecsAttributesUsage ) , WindowsService : flagset . Bool ( windowsServiceFlagName , false , windowsServiceUsage ) , } err := flagset . Parse ( arguments ) if err != nil { return nil , err } return args , nil }
// New creates a new Args object from the argument list
New creates a new Args object from the argument list