func NewAgentFlags()

in internal/flags/flags.go [49:85]


func NewAgentFlags(projectID, zone, instance, projectNumber, image string) *AgentFlags {
	action := flag.String("action", "", "Action for running the agent.")
	onetime := flag.Bool("onetime", false, "Onetime mode for the agent.")
	version := flag.Bool("agent_version", false, "Display the version of the agent.")
	help := flag.Bool("help", false, "Display the usage of each flag.")
	h := flag.Bool("h", false, "Display the usage of each flag.")
	// protocol, address and errorlogfile are used by guest agent.
	protocol := flag.String("protocol", "", "protocol to use uds/tcp")
	address := flag.String("address", "", "address to start server listening on")
	errorLogfile := flag.String("errorlogfile", "", "file to write error logs to")
	logStatus := flag.String("logstatus", "", "log usage status")
	logVersion := flag.String("logversion", "", "log usage version")
	logName := flag.String("logname", "", "name of the log type")

	if !flag.Parsed() {
		flag.Parse()
	}

	return &AgentFlags{
		Action:        *action,
		Onetime:       *onetime,
		Address:       *address,
		Protocol:      *protocol,
		errorLogFile:  *errorLogfile,
		version:       *version,
		help:          *help,
		h:             *h,
		logStatus:     *logStatus,
		logVersion:    *logVersion,
		logName:       *logName,
		projectID:     projectID,
		zone:          zone,
		instance:      instance,
		projectNumber: projectNumber,
		image:         image,
	}
}