tdl/main.go
2023-12-04 16:31:21 +08:00

22 lines
320 B
Go

package main
import (
"context"
"os"
"os/signal"
"github.com/fatih/color"
"github.com/iyear/tdl/cmd"
)
func main() {
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
defer cancel()
if err := cmd.New().ExecuteContext(ctx); err != nil {
color.Red("Error: %+v", err)
os.Exit(1)
}
}