grim/wasdead

move the package to rwgrim/wasdead
draft
2019-06-06, Gary Kramlich
e07a18af6d24
move the package to rwgrim/wasdead
package main
import (
"fmt"
"github.com/alecthomas/kong"
"bitbucket.org/rw_grim/wasdead/commands"
"bitbucket.org/rw_grim/wasdead/globals"
"bitbucket.org/rw_grim/wasdead/run"
)
const (
version = "0.1.0"
)
type versionCmd struct{}
func (c *versionCmd) Run(g *globals.Globals) error {
fmt.Printf("wasdead v%s\n", version)
return nil
}
type cli struct {
globals.Globals
Run run.RunCmd `kong:"cmd,help='Run the bot'"`
Tidy commands.TidyCmd `kong:"cmd,help='clean up the database'"`
Version versionCmd `kong:"cmd,help='Display the version of this program'"`
}
func main() {
cli := cli{}
ctx := kong.Parse(
&cli,
kong.Name("wasdead"),
kong.Description("A live stream announcement bot for discord"),
kong.UsageOnError(),
)
err := ctx.Run(&cli.Globals)
ctx.FatalIfErrorf(err)
}