main.go 486 B

12345678910111213141516171819202122232425262728
  1. package main
  2. import (
  3. "log"
  4. "github.com/alecthomas/kong"
  5. "github.com/ayn2op/discordo/cmd/run"
  6. "github.com/ayn2op/discordo/config"
  7. "github.com/zalando/go-keyring"
  8. )
  9. var cli struct {
  10. Run run.Cmd `cmd:"" default:"withargs"`
  11. }
  12. func main() {
  13. t, _ := keyring.Get(config.Name, "token")
  14. ctx := kong.Parse(&cli, kong.Vars{
  15. "token": t,
  16. "configPath": config.DefaultPath(),
  17. "logPath": config.DefaultLogPath(),
  18. })
  19. err := ctx.Run()
  20. if err != nil {
  21. log.Fatal(err)
  22. }
  23. }