mirror of
https://github.com/iyear/tdl
synced 2025-01-08 11:57:55 +08:00
20 lines
310 B
Go
20 lines
310 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"github.com/fatih/color"
|
|
"github.com/iyear/tdl/cmd"
|
|
"os"
|
|
"os/signal"
|
|
)
|
|
|
|
func main() {
|
|
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
|
|
defer cancel()
|
|
|
|
if err := cmd.New().ExecuteContext(ctx); err != nil {
|
|
color.Red("%v", err)
|
|
os.Exit(1)
|
|
}
|
|
}
|