nf/nft/nfctl/internal/cmd/init.go

27 lines
349 B
Go
Raw Normal View History

2024-12-26 19:40:39 +08:00
package cmd
import (
"context"
"fmt"
"os"
"time"
)
func Init() {
initRoot(
2024-12-26 19:51:31 -08:00
initVersion(),
2024-12-26 19:40:39 +08:00
initUpdate(),
initNew(),
)
}
func Run(ctx context.Context) {
if err := rootCmd.ExecuteContext(ctx); err != nil {
fmt.Printf("❌ %s\n", err.Error())
time.Sleep(300 * time.Millisecond)
os.Exit(1)
}
time.Sleep(300 * time.Millisecond)
}