diff --git a/cmd/control/cmd/root.go b/cmd/control/cmd/root.go index c4642e7..b83c6c9 100644 --- a/cmd/control/cmd/root.go +++ b/cmd/control/cmd/root.go @@ -2,13 +2,12 @@ package cmd import ( "fmt" - "log" "github.com/curusarn/resh/cmd/control/status" "github.com/spf13/cobra" ) -var exitCode status.Code = status.DefaultInvalid +var exitCode status.Code var rootCmd = &cobra.Command{ Use: "reshctl", @@ -31,9 +30,5 @@ func Execute() status.Code { fmt.Println(err) return status.Fail } - if exitCode == status.DefaultInvalid { - log.Println("reshctl FATAL ERROR: (sub)command didn't set exitCode!") - return status.Fail - } return exitCode } diff --git a/cmd/control/status/status.go b/cmd/control/status/status.go index 246225a..28eb3a7 100644 --- a/cmd/control/status/status.go +++ b/cmd/control/status/status.go @@ -4,10 +4,8 @@ package status type Code int const ( - // DefaultInvalid exit code - DefaultInvalid Code = -1 // Success exit code - Success = 0 + Success Code = 0 // Fail exit code Fail = 1 // EnableAll exit code - tells reshctl() wrapper to enable_all