From 98034270c21477f3373248a47ac0eb73a56f990a Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 24 Feb 2021 17:45:23 +0000 Subject: mv cmd/irc cmd/senpai Allows to `go build ./cmd/senpai` without having to specify -o. Also more consistent with how cmd/ is used in the Go ecosystem. --- cmd/irc/main.go | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 cmd/irc/main.go (limited to 'cmd/irc/main.go') diff --git a/cmd/irc/main.go b/cmd/irc/main.go deleted file mode 100644 index 5f7933d..0000000 --- a/cmd/irc/main.go +++ /dev/null @@ -1,49 +0,0 @@ -package main - -import ( - "flag" - "log" - "math/rand" - "os" - "time" - - "git.sr.ht/~taiite/senpai" - "github.com/gdamore/tcell/v2" -) - -func init() { - rand.Seed(time.Now().Unix()) -} - -func main() { - tcell.SetEncodingFallback(tcell.EncodingFallbackASCII) - - var configPath string - var debug bool - flag.StringVar(&configPath, "config", "", "path to the configuration file") - flag.BoolVar(&debug, "debug", false, "show raw protocol data in the home buffer") - flag.Parse() - - if configPath == "" { - configDir, err := os.UserConfigDir() - if err != nil { - log.Panicln(err) - } - configPath = configDir + "/senpai/senpai.yaml" - } - - cfg, err := senpai.LoadConfigFile(configPath) - if err != nil { - log.Panicln(err) - } - - cfg.Debug = cfg.Debug || debug - - app, err := senpai.NewApp(cfg) - if err != nil { - log.Panicln(err) - } - defer app.Close() - - app.Run() -} -- cgit v1.2.3