code: func NewAgent(opts ...Option) Agent {
  	options := newOptions(opts...)
  
  	if !flag.Parsed() {
  		config.DefineDirFlag()
  		for _, p := range options.Plugins {
  			name := p.String()
  			infraLogger.Debugf("registering flags for: %q", name)
  			config.DefineFlagsFor(name)
  		}
  		flag.Parse()
  	}
  
  	return &agent{
  		opts:   options,
  		tracer: measure.NewTracer("agent-plugins"),
  	}
  }
docs: // NewAgent creates a new agent using given options and registers all flags
  // defined for plugins via config.ForPlugin.