@@ -3,11 +3,19 @@ package cmd
33import (
44 "github.com/spf13/cobra"
55 "go.datum.net/datumctl/internal/client"
6- apiresources "go.datum.net/datumctl/internal/cmd/api-resources"
76 "go.datum.net/datumctl/internal/cmd/auth"
8- "go.datum.net/datumctl/internal/cmd/get"
97 "go.datum.net/datumctl/internal/cmd/mcp"
108 "k8s.io/cli-runtime/pkg/genericclioptions"
9+ "k8s.io/kubectl/pkg/cmd/apiresources"
10+ "k8s.io/kubectl/pkg/cmd/apply"
11+ "k8s.io/kubectl/pkg/cmd/clusterinfo"
12+ "k8s.io/kubectl/pkg/cmd/create"
13+ delcmd "k8s.io/kubectl/pkg/cmd/delete"
14+ "k8s.io/kubectl/pkg/cmd/describe"
15+ "k8s.io/kubectl/pkg/cmd/diff"
16+ "k8s.io/kubectl/pkg/cmd/edit"
17+ "k8s.io/kubectl/pkg/cmd/explain"
18+ "k8s.io/kubectl/pkg/cmd/get"
1119)
1220
1321func RootCmd () * cobra.Command {
@@ -34,9 +42,21 @@ func RootCmd() *cobra.Command {
3442 }
3543 factory .AddFlags (rootCmd .PersistentFlags ())
3644 rootCmd .AddCommand (auth .Command ())
37- rootCmd .AddCommand (get .Command (factory , ioStreams ))
38- rootCmd .AddCommand (apiresources .Command (factory , ioStreams ))
39- rootCmd .AddCommand (apiresources .CommandApiResources (factory , ioStreams ))
45+
46+ rootCmd .AddCommand (WrapResourceCommand (get .NewCmdGet ("datumctl" , factory , ioStreams )))
47+ rootCmd .AddCommand (WrapResourceCommand (delcmd .NewCmdDelete (factory , ioStreams )))
48+ rootCmd .AddCommand (create .NewCmdCreate (factory , ioStreams ))
49+ rootCmd .AddCommand (apply .NewCmdApply ("datumctl" , factory , ioStreams ))
50+ rootCmd .AddCommand (WrapResourceCommand (edit .NewCmdEdit (factory , ioStreams )))
51+ rootCmd .AddCommand (WrapResourceCommand (describe .NewCmdDescribe ("datumctl" , factory , ioStreams )))
52+
53+ rootCmd .AddCommand (diff .NewCmdDiff (factory , ioStreams ))
54+ rootCmd .AddCommand (explain .NewCmdExplain ("datumctl" , factory , ioStreams ))
55+
56+ rootCmd .AddCommand (apiresources .NewCmdAPIVersions (factory , ioStreams ))
57+ rootCmd .AddCommand (clusterinfo .NewCmdClusterInfo (factory , ioStreams ))
58+ rootCmd .AddCommand (apiresources .NewCmdAPIResources (factory , ioStreams ))
59+
4060 rootCmd .AddCommand (mcp .Command ())
4161 return rootCmd
4262}
0 commit comments