diff --git a/cmd/shogo/commands/root.go b/cmd/shogo/commands/root.go index 19b0922..d438a6b 100644 --- a/cmd/shogo/commands/root.go +++ b/cmd/shogo/commands/root.go @@ -1,12 +1,13 @@ package commands import ( + "fmt" "os" - "github.com/fatih/color" "github.com/spf13/cobra" "git.tcp.direct/perp/shogo/cmd/shogo/commands/alert" + "git.tcp.direct/perp/shogo/cmd/shogo/commands/scan" "git.tcp.direct/perp/shogo/internal/utils" ) @@ -17,7 +18,7 @@ var rootCmd = &cobra.Command{ Run: func(cmd *cobra.Command, _ []string) { utils.CheckColor() if err := cmd.Help(); err != nil { - color.Red("Error: %s", err.Error()) + fmt.Printf("%s: %s\n", utils.Red("Error"), err.Error()) os.Exit(1) } }, @@ -37,16 +38,20 @@ func init() { rootCmd.AddCommand(infoCmd) rootCmd.AddCommand(myIPCmd) rootCmd.AddCommand(searchCmd) + rootCmd.AddCommand(statsCmd) rootCmd.AddCommand(versionCmd) // Add subcommands rootCmd.AddCommand(alert.AlertCmd) + rootCmd.AddCommand(scan.ScanCmd) } // Execute command func Execute() { if err := rootCmd.Execute(); err != nil { - color.Red("Error: %s", err.Error()) + fmt.Printf("%s: %s\n", utils.Red("Error"), err.Error()) os.Exit(1) } } + +// Todo: Make mutliple arguments threaded