forked from LaconicNetwork/kompose
make kompose exit with 1 if error (#1343)
Old code passes -1 to os.Exit and the value is directly passed to syscall. The behavior with -1 depends on environments (most cases should convert into 255 though) This commit is to remove unnecessary the ambiguity and change it to use 1 instead of 255.
This commit is contained in:
parent
ee3ae26198
commit
45864ed624
12
cmd/root.go
12
cmd/root.go
@ -17,8 +17,6 @@ limitations under the License.
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
@ -87,12 +85,10 @@ var RootCmd = &cobra.Command{
|
||||
},
|
||||
}
|
||||
|
||||
// Execute TODO: comment
|
||||
func Execute() {
|
||||
if err := RootCmd.Execute(); err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(-1)
|
||||
}
|
||||
// Execute executes the root level command.
|
||||
// It returns an erorr if any.
|
||||
func Execute() error {
|
||||
return RootCmd.Execute()
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user