sq/main.go
2020-08-06 11:58:47 -06:00

29 lines
439 B
Go

// Package main contains sq's main function.
package main
import (
"context"
"os"
"os/signal"
"github.com/neilotoole/sq/cli"
)
func main() {
ctx, cancelFn := context.WithCancel(context.Background())
defer cancelFn()
go func() {
stop := make(chan os.Signal, 1)
signal.Notify(stop, os.Interrupt)
<-stop
cancelFn()
}()
err := cli.Execute(ctx, os.Stdin, os.Stdout, os.Stderr, os.Args)
if err != nil {
os.Exit(1)
}
}