mirror of
https://github.com/iyear/tdl
synced 2025-01-09 04:17:35 +08:00
22 lines
320 B
Go
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)
|
|
}
|
|
}
|