本文整理汇总了Golang中github.com/spf13/cobra.Command.Short方法的典型用法代码示例。如果您正苦于以下问题:Golang Command.Short方法的具体用法?Golang Command.Short怎么用?Golang Command.Short使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/spf13/cobra.Command
的用法示例。
在下文中一共展示了Command.Short方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Init
func (c *UpCmd) Init(cc *cobra.Command) {
cc.Use = "up [# path]"
cc.Short = "upload BLOBs to bar server"
cc.Flags().BoolVarP(&c.UseGit, "git", "", false, "use git infrastructure")
cc.Flags().BoolVarP(&c.Squash, "squash", "", false,
"squash uploaded BLOBs to manifests after upload")
}
示例2: Init
func (c *GitDivertFinishCmd) Init(cc *cobra.Command) {
cc.Use = "finish"
cc.Short = "finish covert op"
cc.Flags().StringVarP(&c.Message, "message", "m", "",
"git commit message")
}
示例3: Init
func (c *SpecExportCmd) Init(cc *cobra.Command) {
cc.Use = "export [# path]"
cc.Short = "export spec"
cc.Flags().BoolVarP(&c.UseGit, "git", "", false, "use git infrastructure")
cc.Flags().BoolVarP(&c.Upload, "upload", "u", false, "upload spec to bar server")
cc.Flags().BoolVarP(&c.DoCC, "cc", "", false, "create carbon copy")
}
示例4: Init
func (c *GitInstallCmd) Init(cc *cobra.Command) {
cc.Use = "install"
cc.Short = "install bar support into git repo"
cc.Flags().StringVarP(&c.Log, "log", "", logx.INFO,
"installable logging level")
cc.Flags()
}
示例5: Init
func (c *SpecImportCmd) Init(cc *cobra.Command) {
cc.Use = "import [spec-id]"
cc.Short = "import spec from bard server"
cc.Flags().BoolVarP(&c.UseGit, "git", "", false, "use git infrastructure")
cc.Flags().BoolVarP(&c.Raw, "raw", "", false,
"read spec from STDIN instead request from bar server")
cc.Flags().BoolVarP(&c.Squash, "squash", "", false,
"write manifests after import")
}
示例6: Init
func (c *ServerRunCmd) Init(cc *cobra.Command) {
cc.Use = "run"
cc.Short = "run bar server instance (bard)"
cc.Flags().StringVarP(&c.BindHTTP, "bind-http", "", ":3000", "http bind")
cc.Flags().StringVarP(&c.BindRPC, "bind-rpc", "", ":3001", "rpc bind")
cc.Flags().StringVarP(&c.HTTPEndpoint, "endpoint-http", "",
"http://localhost:3000/v1", "http endpoint")
cc.Flags().StringVarP(&c.BinDir, "bin-dir", "", "dist/bindir",
"binaries directory")
cc.Flags().StringVarP(&c.Storage, "storage", "",
"block:root=data,split=2,max-files=128,pool=64",
"storage configuration")
}
示例7: Init
func (c *LsCmd) Init(cc *cobra.Command) {
cc.Use = "ls [# path]"
cc.Short = "show info about bar-tracked BLOBs"
cc.Flags().BoolVarP(&c.UseGit, "git", "", false, "use git infrastructure")
cc.Flags().BoolVarP(&c.NoHeader, "no-header", "", false,
"do not print header")
cc.Flags().BoolVarP(&c.FullID, "full-id", "", false,
"do not trim blob IDs")
cc.Flags().BoolVarP(&c.NoBlobs, "no-blobs", "", false,
"do not collect BLOBs")
cc.Flags().BoolVarP(&c.NoManifests, "no-manifests", "", false,
"do not collect manifests")
cc.Flags().BoolVarP(&c.NoRemote, "no-remote", "", false,
"do not request bard for BLOBs states")
cc.Flags().BoolVarP(&c.NoName, "no-name", "", false,
"do not print BLOB filenames")
cc.Flags().BoolVarP(&c.NoID, "no-id", "", false, "do not print BLOB IDs")
cc.Flags().BoolVarP(&c.NoSize, "no-size", "", false,
"do not print BLOB sizes")
}
示例8: moved
func moved(fullName, to string, parent, cmd *cobra.Command) string {
cmd.Long = fmt.Sprintf("DEPRECATED: This command has been moved to \"%s %s\"", fullName, to)
cmd.Short = fmt.Sprintf("DEPRECATED: %s", to)
parent.AddCommand(cmd)
return cmd.Name()
}
示例9: Init
func (c *VersionCmd) Init(cc *cobra.Command) {
cc.Use = "version"
cc.Short = "print version and exit"
}
示例10: Init
func (c *PingCmd) Init(cc *cobra.Command) {
cc.Use = "ping"
cc.Short = "ping bar server"
}
示例11: Init
func (c *GitDivertStatusCmd) Init(cc *cobra.Command) {
cc.Use = "status"
cc.Short = "covert op status"
}
示例12: Init
func (c *GitDivertRootCmd) Init(cc *cobra.Command) {
cc.Use = "divert"
cc.Short = "git diversions"
}
示例13: Init
func (c *GitSmudgeCmd) Init(cc *cobra.Command) {
cc.Use = "smudge"
cc.Short = "git smudge filter"
}
示例14: Deprecated
func Deprecated(baseName, to string, parent, cmd *cobra.Command) string {
cmd.Long = fmt.Sprintf("Deprecated: This command is deprecated, all its functionalities are covered by \"%s %s\"", baseName, to)
cmd.Short = fmt.Sprintf("Deprecated: %s", to)
parent.AddCommand(cmd)
return cmd.Name()
}
示例15: Init
func (c *GitCmd) Init(cc *cobra.Command) {
cc.Use = "git"
cc.Short = "git-specific operations"
}