INNER CODE UNIT · Go

main

umputun/spot · cmd/spot/main.go:102

func main() {
	var opts options
	p := flags.NewParser(&opts, flags.PrintErrors|flags.PassDoubleDash|flags.HelpFlag)
	if _, err := p.Parse(); err != nil {
		if !errors.Is(err.(*flags.Error).Type, flags.ErrHelp) {
			// cli error, not help
			fmt.Printf("%v", err)
			os.Exit(1)
		}
		os.Exit(0) // help printed
	}

	if opts.Version {
		fmt.Printf("spot %s\n", revision)
		os.Exit(0)
	}

	setupLog(opts.Dbg) // set initial log, will be updated later with secrets

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…