Files
Chi-Sheng LiuandGitHub 3445a03261 [Refactor][kubectl-plugin] Change kubectl ray cluster get to get cluster (#2493)
See the description in the corresponding issue for details.



Closes: ray-project/kuberay#2492

Signed-off-by: Chi-Sheng Liu <[email protected]>
2024-11-19 09:14:19 -08:00

29 lines
700 B
Go

package get
import (
"fmt"
"strings"
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
)
func NewGetCommand(streams genericclioptions.IOStreams) *cobra.Command {
cmd := &cobra.Command{
Use: "get",
Short: "Display one or many Ray resources.",
Long: `Prints a table of the most important information about the specified Ray resources.`,
Aliases: []string{"list"},
SilenceUsage: true,
Run: func(cmd *cobra.Command, args []string) {
if len(args) > 0 {
fmt.Println(fmt.Errorf("unknown command(s) %q", strings.Join(args, " ")))
}
cmd.HelpFunc()(cmd, args)
},
}
cmd.AddCommand(NewGetClusterCommand(streams))
return cmd
}