Files
BanForge/cmd/banforge/main.go
d3m0k1d 7d9645b3e3
All checks were successful
CI.yml / build (push) Successful in 1m49s
refactoring(cmd/banforge/main.go): command logic on command dir in different files
2026-01-14 21:52:13 +03:00

41 lines
644 B
Go

package main
import (
"fmt"
"os"
"github.com/d3m0k1d/BanForge/cmd/banforge/command"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "banforge",
Short: "IPS log-based written on Golang",
Run: func(cmd *cobra.Command, args []string) {
},
}
func Init() {
}
func Execute() {
rootCmd.AddCommand(command.DaemonCmd)
rootCmd.AddCommand(command.InitCmd)
rootCmd.AddCommand(command.RuleCmd)
rootCmd.AddCommand(command.BanCmd)
rootCmd.AddCommand(command.UnbanCmd)
command.RuleRegister()
command.FwRegister()
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
func main() {
Execute()
}