INNER CODE UNIT · Go

main

joshuar/go-hass-agent · main.go:54

func main() {
	// Set some string.
	kong.Name(config.AppName)
	kong.Description(config.AppDescription)
	// Parse the command-line.
	cmdCtx := kong.Parse(&CLI, kong.Bind(), kong.Vars{"defaultPath": config.GetPath()})
	config.SetPath(CLI.Path)
	// Set up the logger.
	logging.New(config.GetPath(), logging.Options{LogLevel: CLI.LogLevel, NoLogFile: CLI.NoLogFile})
	// Enable profiling if requested.
	if CLI.ProfileFlags != nil {
		if err := logging.StartProfiling(CLI.ProfileFlags); err != nil {
			slog.Warn("Problem starting profiling.",
				slog.Any("error", err))
		}
	}
	// Initialise the config.
	err := config.Init()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…