package main import ( "context" "flag" "fmt" "git.faercol.me/faercol/public-ip-tracker/tracker/bot" "git.faercol.me/faercol/public-ip-tracker/tracker/config" ) type cliArgs struct { configPath string } func parseArgs() *cliArgs { configPath := flag.String("config", "", "Path to the JSON configuration file") flag.Parse() return &cliArgs{ configPath: *configPath, } } func main() { fmt.Println("Parsing arguments") args := parseArgs() fmt.Println("Parsing config") conf, err := config.New(args.configPath) if err != nil { panic(err) } fmt.Println("Initializing bot") notifBot := bot.New(context.Background(), conf) if err := notifBot.SendInitMessage(); err != nil { panic(err) } fmt.Println("OK") }