@@ -18,6 +18,7 @@ import (
18
18
"k8s.io/kubernetes/pkg/kubectl/cmd/config"
19
19
"k8s.io/kubernetes/pkg/kubectl/cmd/resource"
20
20
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
21
+ "k8s.io/kubernetes/pkg/kubectl/util/i18n"
21
22
22
23
cmdutil "github.com/openshift/origin/pkg/cmd/util"
23
24
"github.com/openshift/origin/pkg/oc/cli/cmd/create"
@@ -788,3 +789,39 @@ func NewCmdAuth(fullName string, f *clientcmd.Factory, out, errout io.Writer) *c
788
789
func NewCmdPlugin (fullName string , f * clientcmd.Factory , in io.Reader , out , errout io.Writer ) * cobra.Command {
789
790
return kcmd .NewCmdPlugin (f , in , out , errout )
790
791
}
792
+
793
+ var (
794
+ apiresourcesExample = templates .Examples (`
795
+ # Print the supported API Resources
796
+ %[1]s api-resources
797
+
798
+ # Print the supported API Resources with more information
799
+ %[1]s api-resources -o wide
800
+
801
+ # Print the supported namespaced resources
802
+ %[1]s api-resources --namespaced=true
803
+
804
+ # Print the supported non-namespaced resources
805
+ %[1]s api-resources --namespaced=false
806
+
807
+ # Print the supported API Resources with specific APIGroup
808
+ %[1]s api-resources --api-group=extensions` )
809
+ )
810
+
811
+ func NewCmdApiResources (fullName string , f * clientcmd.Factory , out io.Writer ) * cobra.Command {
812
+ cmd := kcmd .NewCmdApiResources (f , out )
813
+ cmd .Example = fmt .Sprintf (apiresourcesExample , fullName )
814
+ return cmd
815
+ }
816
+
817
+ var (
818
+ apiversionsExample = templates .Examples (i18n .T (`
819
+ # Print the supported API versions
820
+ %[1]s api-versions` ))
821
+ )
822
+
823
+ func NewCmdApiVersions (fullName string , f * clientcmd.Factory , out io.Writer ) * cobra.Command {
824
+ cmd := kcmd .NewCmdApiVersions (f , out )
825
+ cmd .Example = fmt .Sprintf (apiversionsExample , fullName )
826
+ return cmd
827
+ }
0 commit comments