Bluemage/go/cmd/bluemage/main.go

29 lines
455 B
Go
Raw Normal View History

2024-08-04 23:16:05 +07:00
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)
}
2024-08-05 23:06:32 +07:00
func main() {
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
defer cancel()
if err := Cmd.ExecuteContext(ctx); err != nil {
os.Exit(1)
}
2024-08-05 23:06:32 +07:00
}