func NewKubectlServer() *Server { cmd := cmd.NewKubectlCommand(cmdutil.NewFactory(nil), os.Stdin, os.Stdout, os.Stderr) localFlags := cmd.LocalFlags() localFlags.SetInterspersed(false) return &Server{ name: "kubectl", SimpleUsage: "Kubernetes command line client", Long: "Kubernetes command line client", Run: func(s *Server, args []string) error { cmd.SetArgs(args) return cmd.Execute() }, flags: localFlags, } }
func NewKubectlServer() *Server { // need to use term.StdStreams to get the right IO refs on Windows stdin, stdout, stderr := term.StdStreams() cmd := cmd.NewKubectlCommand(cmdutil.NewFactory(nil), stdin, stdout, stderr) localFlags := cmd.LocalFlags() localFlags.SetInterspersed(false) return &Server{ name: "kubectl", SimpleUsage: "Kubernetes command line client", Long: "Kubernetes command line client", Run: func(s *Server, args []string) error { cmd.SetArgs(args) return cmd.Execute() }, flags: localFlags, } }