当前位置: 首页>>代码示例>>Golang>>正文


Golang Command.Short方法代码示例

本文整理汇总了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")
}
开发者ID:pombredanne,项目名称:bar,代码行数:7,代码来源:up.go

示例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")
}
开发者ID:pombredanne,项目名称:bar,代码行数:7,代码来源:git-divert-finish.go

示例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")
}
开发者ID:akaspin,项目名称:bar,代码行数:8,代码来源:spec-export.go

示例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()
}
开发者ID:pombredanne,项目名称:bar,代码行数:9,代码来源:git-install.go

示例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")
}
开发者ID:pombredanne,项目名称:bar,代码行数:10,代码来源:spec-import.go

示例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")
}
开发者ID:pombredanne,项目名称:bar,代码行数:15,代码来源:server-run.go

示例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")
}
开发者ID:pombredanne,项目名称:bar,代码行数:24,代码来源:ls.go

示例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()
}
开发者ID:arilivigni,项目名称:origin,代码行数:6,代码来源:cli.go

示例9: Init

func (c *VersionCmd) Init(cc *cobra.Command) {
	cc.Use = "version"
	cc.Short = "print version and exit"
}
开发者ID:pombredanne,项目名称:bar,代码行数:4,代码来源:version.go

示例10: Init

func (c *PingCmd) Init(cc *cobra.Command) {
	cc.Use = "ping"
	cc.Short = "ping bar server"
}
开发者ID:pombredanne,项目名称:bar,代码行数:4,代码来源:ping.go

示例11: Init

func (c *GitDivertStatusCmd) Init(cc *cobra.Command) {
	cc.Use = "status"
	cc.Short = "covert op status"
}
开发者ID:pombredanne,项目名称:bar,代码行数:4,代码来源:git-divert-status.go

示例12: Init

func (c *GitDivertRootCmd) Init(cc *cobra.Command) {
	cc.Use = "divert"
	cc.Short = "git diversions"
}
开发者ID:pombredanne,项目名称:bar,代码行数:4,代码来源:git-divert.go

示例13: Init

func (c *GitSmudgeCmd) Init(cc *cobra.Command) {
	cc.Use = "smudge"
	cc.Short = "git smudge filter"
}
开发者ID:pombredanne,项目名称:bar,代码行数:4,代码来源:git-smudge.go

示例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()
}
开发者ID:Q-Lee,项目名称:kubernetes,代码行数:6,代码来源:cmd.go

示例15: Init

func (c *GitCmd) Init(cc *cobra.Command) {
	cc.Use = "git"
	cc.Short = "git-specific operations"
}
开发者ID:pombredanne,项目名称:bar,代码行数:4,代码来源:git.go


注:本文中的github.com/spf13/cobra.Command.Short方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。