func doRun()

in main.go [62:98]


func doRun(_ *cobra.Command, _ []string) error {
	initLogging(args.LogLevel)

	zap.S().Infow("Loading configuration", "path", args.Config)
	conf, err := config.Load(args)
	if err != nil {
		zap.S().Errorw("Failed to read config", "error", err)
		return err
	}

	r, err := renderer.New(conf)
	if err != nil {
		zap.S().Errorw("Failed to create renderer", "error", err)
		return err
	}

	startTime := time.Now()
	defer func() {
		zap.S().Infof("Execution time: %s", time.Since(startTime))
	}()

	zap.S().Infow("Processing source directory", "directory", conf.SourcePath, "depth", conf.MaxDepth)
	gvd, err := processor.Process(conf)
	if err != nil {
		zap.S().Errorw("Failed to process source directory", "error", err)
		return err
	}

	zap.S().Infow("Rendering output", "path", conf.OutputPath)
	if err := r.Render(gvd); err != nil {
		zap.S().Errorw("Failed to render", "error", err)
		return err
	}

	zap.S().Info("CRD reference documentation generated")
	return nil
}