nf/nft/nfctl/main.go

27 lines
474 B
Go
Raw Permalink Normal View History

2024-07-09 18:08:49 +08:00
package main
import (
"context"
"github.com/loveuer/nf/nft/nfctl/cmd"
"github.com/loveuer/nf/nft/nfctl/version"
"os/signal"
"syscall"
2024-07-12 16:33:35 +08:00
"time"
2024-07-09 18:08:49 +08:00
)
func main() {
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
defer cancel()
2024-07-09 18:08:49 +08:00
version.Check()
defer version.Fn()
2024-07-09 18:08:49 +08:00
_ = cmd.Root.ExecuteContext(ctx)
2024-07-12 16:33:35 +08:00
select {
case <-time.After(3 * time.Second):
case <-ctx.Done():
case <-version.OkCh:
}
2024-07-09 18:08:49 +08:00
}