Bluemage/go/cmd/bluemage/main.go

29 lines
455 B
Go

package main
import (
"context"
"os"
"os/signal"
"github.com/spf13/cobra"
"github.com/tigorlazuardi/bluemage/go/cmd/bluemage/serve"
)
var Cmd = &cobra.Command{
Use: "bluemage",
Short: "Bluemage is a reddit image downloader",
}
func init() {
Cmd.AddCommand(serve.Cmd)
}
func main() {
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
defer cancel()
if err := Cmd.ExecuteContext(ctx); err != nil {
os.Exit(1)
}
}