Browse code

Immediate exit if the return of is

update

update

Yanqiang Miao authored on 2016/09/13 11:40:50
Showing 1 changed files
... ...
@@ -6,6 +6,7 @@ import (
6 6
 	"fmt"
7 7
 	"io"
8 8
 	"io/ioutil"
9
+	"os"
9 10
 	"path"
10 11
 	"strconv"
11 12
 	"strings"
... ...
@@ -157,7 +158,11 @@ func NewCmdRegistry(f *clientcmd.Factory, parentName, name string, out io.Writer
157 157
 				Config: cfg,
158 158
 			}
159 159
 			kcmdutil.CheckErr(opts.Complete(f, cmd, out, args))
160
-			kcmdutil.CheckErr(opts.RunCmdRegistry())
160
+			err := opts.RunCmdRegistry()
161
+			if err == cmdutil.ErrExit {
162
+				os.Exit(1)
163
+			}
164
+			kcmdutil.CheckErr(err)
161 165
 		},
162 166
 	}
163 167