Minor change

pull/18/head
Simon Let 6 years ago
parent 82a40f7f29
commit d4959cffbe
  1. 7
      cmd/control/cmd/root.go
  2. 4
      cmd/control/status/status.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
}

@ -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

Loading…
Cancel
Save