Golang Command.Use Examples

Golang Command.Use - 22 examples found. These are the top rated real world Golang examples of github.com/spf13/cobra.Command.Use extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
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")
}
Example #2
0
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")
}
Example #3
0
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")
}
Example #4
0
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()
}
Example #5
0
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")
}
Example #6
0
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")
}