Improve message from kubectl config

1.use Fprintf instead of Printf
2.output simple success messages
3.lowercase all error messages
This commit is contained in:
hurf
2015-09-23 16:08:42 +08:00
parent 45a8b5f98a
commit c4dc056105
11 changed files with 45 additions and 33 deletions

View File

@@ -58,7 +58,9 @@ func NewCmdConfigSetContext(out io.Writer, configAccess ConfigAccess) *cobra.Com
err := options.run()
if err != nil {
fmt.Printf("%v\n", err)
fmt.Fprintf(out, "%v\n", err)
} else {
fmt.Fprintf(out, "context %q set.\n", options.name)
}
},
}
@@ -124,7 +126,7 @@ func (o *createContextOptions) complete(cmd *cobra.Command) bool {
func (o createContextOptions) validate() error {
if len(o.name) == 0 {
return errors.New("You must specify a non-empty context name")
return errors.New("you must specify a non-empty context name")
}
return nil