2024-08-04 23:16:05 +07:00
|
|
|
package main
|
|
|
|
|
2024-08-06 22:13:37 +07:00
|
|
|
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() {
|
2024-08-06 22:13:37 +07:00
|
|
|
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
|
|
|
}
|