當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Command.Usage方法代碼示例

本文整理匯總了Golang中github.com/maximilien/bosh-bmp-cli/cmds.Command.Usage方法的典型用法代碼示例。如果您正苦於以下問題:Golang Command.Usage方法的具體用法?Golang Command.Usage怎麽用?Golang Command.Usage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/maximilien/bosh-bmp-cli/cmds.Command的用法示例。


在下文中一共展示了Command.Usage方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1:

	Describe("#Name", func() {
		It("returns the name of a LoginCommand", func() {
			Expect(cmd.Name()).To(Equal("login"))
		})
	})

	Describe("#Description", func() {
		It("returns the description of a LoginCommand", func() {
			Expect(cmd.Description()).To(Equal("Login to the Bare Metal Provision Server"))
		})
	})

	Describe("#Usage", func() {
		It("returns the usage text of a LoginCommand", func() {
			Expect(cmd.Usage()).To(Equal("bmp login"))
		})
	})

	Describe("#Validate", func() {
		It("validates a good LoginCommand", func() {
			validate, err := cmd.Validate()
			Expect(validate).To(BeTrue())
			Expect(err).ToNot(HaveOccurred())
		})
	})

	Describe("#Execute", func() {
		It("executes a good LoginCommand", func() {
			rc, err := cmd.Execute(args)
			Expect(rc).To(Equal(0))
開發者ID:gitter-badger,項目名稱:bosh-bmp-cli,代碼行數:30,代碼來源:login_command_test.go

示例2:

	Describe("#Name", func() {
		It("returns the name of a TaskCommand", func() {
			Expect(cmd.Name()).To(Equal("task"))
		})
	})

	Describe("#Description", func() {
		It("returns the description of a TaskCommand", func() {
			Expect(cmd.Description()).To(Equal(`Show the output of the task: \"option --debug, Get the debug info of the task\"`))
		})
	})

	Describe("#Usage", func() {
		It("returns the usage text of a TaskCommand", func() {
			Expect(cmd.Usage()).To(Equal("bmp task <task-id>"))
		})
	})

	Describe("#Validate", func() {
		It("validates a good TaskCommand", func() {
			validate, err := cmd.Validate()
			Expect(validate).To(BeTrue())
			Expect(err).ToNot(HaveOccurred())
		})
	})

	Describe("#Execute", func() {
		It("executes a good TaskCommand", func() {
			rc, err := cmd.Execute(args)
			Expect(rc).To(Equal(0))
開發者ID:gitter-badger,項目名稱:bosh-bmp-cli,代碼行數:30,代碼來源:task_command_test.go

示例3:

	Describe("#Name", func() {
		It("returns the name of a UpdateStateCommand", func() {
			Expect(cmd.Name()).To(Equal("update-state"))
		})
	})

	Describe("#Description", func() {
		It("returns the description of a UpdateStateCommand", func() {
			Expect(cmd.Description()).To(Equal(`Update the server state (\"bm.state.new\", \"bm.state.using\", \"bm.state.loading\", \"bm.state.failed\", \"bm.state.deleted\")`))
		})
	})

	Describe("#Usage", func() {
		It("returns the usage text of a UpdateStateCommand", func() {
			Expect(cmd.Usage()).To(Equal("bmp update-state <bm.state.new>"))
		})
	})

	Describe("#Validate", func() {
		It("validates a good UpdateStateCommand", func() {
			validate, err := cmd.Validate()
			Expect(validate).To(BeTrue())
			Expect(err).ToNot(HaveOccurred())
		})
	})

	Describe("#Execute", func() {
		It("executes a good UpdateStateCommand", func() {
			rc, err := cmd.Execute(args)
			Expect(rc).To(Equal(0))
開發者ID:gitter-badger,項目名稱:bosh-bmp-cli,代碼行數:30,代碼來源:update_state_command_test.go

示例4:

	Describe("#Name", func() {
		It("returns the name of a CreateBaremetalsCommand", func() {
			Expect(cmd.Name()).To(Equal("create-baremetals"))
		})
	})

	Describe("#Description", func() {
		It("returns the description of a CreateBaremetalsCommand", func() {
			Expect(cmd.Description()).To(Equal(`Create the missed baremetals: \"option --dryrun, only verify the orders\"`))
		})
	})

	Describe("#Usage", func() {
		It("returns the usage text of a CreateBaremetalsCommand", func() {
			Expect(cmd.Usage()).To(Equal("bmp create-baremetals [--dryrun]"))
		})
	})

	Describe("#Validate", func() {
		It("validates a good BmsCommand", func() {
			validate, err := cmd.Validate()
			Expect(validate).To(BeTrue())
			Expect(err).ToNot(HaveOccurred())
		})
	})

	Describe("#Execute", func() {
		It("executes a good BmsCommand", func() {
			rc, err := cmd.Execute(args)
			Expect(rc).To(Equal(0))
開發者ID:gitter-badger,項目名稱:bosh-bmp-cli,代碼行數:30,代碼來源:create_baremetals_command_test.go

示例5:

	Describe("#Name", func() {
		It("returns the name of a TasksCommand", func() {
			Expect(cmd.Name()).To(Equal("tasks"))
		})
	})

	Describe("#Description", func() {
		It("returns the description of a TasksCommand", func() {
			Expect(cmd.Description()).To(Equal(`List tasks: \"option --latest number\", \"The number of latest tasks, default is 50\"`))
		})
	})

	Describe("#Usage", func() {
		It("returns the usage text of a TasksCommand", func() {
			Expect(cmd.Usage()).To(Equal("bmp tasks"))
		})
	})

	Describe("#Validate", func() {
		It("validates a good TasksCommand", func() {
			validate, err := cmd.Validate()
			Expect(validate).To(BeTrue())
			Expect(err).ToNot(HaveOccurred())
		})
	})

	Describe("#Execute", func() {
		It("executes a good TasksCommand", func() {
			rc, err := cmd.Execute(args)
			Expect(rc).To(Equal(0))
開發者ID:gitter-badger,項目名稱:bosh-bmp-cli,代碼行數:30,代碼來源:tasks_command_test.go


注:本文中的github.com/maximilien/bosh-bmp-cli/cmds.Command.Usage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。