INNER CODE UNIT · Go

main

grafana-cold-storage/phlare · tools/doc-generator/main.go:133

func main() {
	// Parse the generator flags.
	flag.Parse()
	if flag.NArg() != 1 {
		fmt.Fprintf(os.Stderr, "Usage: doc-generator template-file")
		os.Exit(1)
	}

	templatePath := flag.Arg(0)

	// In order to match YAML config fields with CLI flags, we map
	// the memory address of the CLI flag variables and match them with
	// the config struct fields' addresses.
	cfg := &phlare.Config{}
	flags := parse.Flags(cfg, log.NewLogfmtLogger(os.Stderr))

	// Parse the config, mapping each config field with the related CLI flag.
	blocks, err := parse.Config(cfg, flags, parse.RootBlocks)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…