本文整理汇总了Golang中vulcan/kubernetes/pkg/kubectl/cmd/util.Factory.BindFlags方法的典型用法代码示例。如果您正苦于以下问题:Golang Factory.BindFlags方法的具体用法?Golang Factory.BindFlags怎么用?Golang Factory.BindFlags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vulcan/kubernetes/pkg/kubectl/cmd/util.Factory
的用法示例。
在下文中一共展示了Factory.BindFlags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: NewKubectlCommand
// NewKubectlCommand creates the `kubectl` command and its nested children.
func NewKubectlCommand(f *cmdutil.Factory, in io.Reader, out, err io.Writer) *cobra.Command {
// Parent command to which all subcommands are added.
cmds := &cobra.Command{
Use: "kubectl",
Short: "kubectl controls the Kubernetes cluster manager",
Long: `kubectl controls the Kubernetes cluster manager.
Find more information at https://github.com/kubernetes/kubernetes.`,
Run: runHelp,
BashCompletionFunction: bash_completion_func,
}
f.BindFlags(cmds.PersistentFlags())
// From this point and forward we get warnings on flags that contain "_" separators
cmds.SetGlobalNormalizationFunc(util.WarnWordSepNormalizeFunc)
cmds.AddCommand(NewCmdGet(f, out))
cmds.AddCommand(NewCmdDescribe(f, out))
cmds.AddCommand(NewCmdCreate(f, out))
cmds.AddCommand(NewCmdReplace(f, out))
cmds.AddCommand(NewCmdPatch(f, out))
cmds.AddCommand(NewCmdDelete(f, out))
cmds.AddCommand(NewCmdEdit(f, out))
cmds.AddCommand(NewCmdApply(f, out))
cmds.AddCommand(NewCmdNamespace(out))
cmds.AddCommand(NewCmdLog(f, out))
cmds.AddCommand(NewCmdRollingUpdate(f, out))
cmds.AddCommand(NewCmdScale(f, out))
cmds.AddCommand(NewCmdAttach(f, in, out, err))
cmds.AddCommand(NewCmdExec(f, in, out, err))
cmds.AddCommand(NewCmdPortForward(f))
cmds.AddCommand(NewCmdProxy(f, out))
cmds.AddCommand(NewCmdRun(f, in, out, err))
cmds.AddCommand(NewCmdStop(f, out))
cmds.AddCommand(NewCmdExposeService(f, out))
cmds.AddCommand(NewCmdAutoscale(f, out))
cmds.AddCommand(NewCmdLabel(f, out))
cmds.AddCommand(NewCmdAnnotate(f, out))
cmds.AddCommand(cmdconfig.NewCmdConfig(cmdconfig.NewDefaultPathOptions(), out))
cmds.AddCommand(NewCmdClusterInfo(f, out))
cmds.AddCommand(NewCmdApiVersions(f, out))
cmds.AddCommand(NewCmdVersion(f, out))
cmds.AddCommand(NewCmdExplain(f, out))
cmds.AddCommand(NewCmdConvert(f, out))
return cmds
}