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


Golang Command.Description方法代碼示例

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


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

示例1:

			cmd2 := bmp.NewStemcellsCommand(options, fakeBmpClient)
			Expect(cmd2).ToNot(BeNil())
			Expect(cmd2).To(Equal(cmd))
		})
	})

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

	Describe("#Description", func() {
		It("returns the description of a StemcellsCommand", func() {
			Expect(cmd.Description()).To(Equal("List all stemcells"))
		})
	})

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

	Describe("#Options", func() {
		It("returns the options of a StemcellsCommand", func() {
			Expect(cmds.EqualOptions(cmd.Options(), options)).To(BeTrue())
		})
	})
開發者ID:cloudfoundry-community,項目名稱:bosh-softlayer-tools,代碼行數:29,代碼來源:stemcells_command_test.go

示例2:

			cmd2 := bmp.NewBmsCommand(options, fakeBmpClient)
			Expect(cmd2).ToNot(BeNil())
			Expect(cmd2).To(Equal(cmd))
		})
	})

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

	Describe("#Description", func() {
		It("returns the description of a BmsCommand", func() {
			Expect(cmd.Description()).To(Equal("List all bare metals"))
		})
	})

	Describe("#Usage", func() {
		It("returns the usage text of a BmsCommand", func() {
			Expect(cmd.Usage()).To(Equal("bmp bms --deployment[-d] <deployment file>"))
		})
	})

	Describe("#Options", func() {
		It("returns the options of a BmsCommand", func() {
			Expect(cmds.EqualOptions(cmd.Options(), options)).To(BeTrue())

			Expect(cmd.Options().Deployment).ToNot(Equal(""))
			Expect(cmd.Options().Deployment).To(Equal("../../test_fixtures/bmp/deployment.yml"))
開發者ID:cloudfoundry-community,項目名稱:bosh-softlayer-tools,代碼行數:30,代碼來源:bms_command_test.go

示例3:

			cmd2 := bmp.NewSlCommand(options, fakeBmpClient)
			Expect(cmd2).ToNot(BeNil())
			Expect(cmd2).To(Equal(cmd))
		})
	})

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

	Describe("#Description", func() {
		It("returns the description of a SlCommand", func() {
			Expect(cmd.Description()).To(Equal("List all Softlayer packages or package options"))
		})
	})

	Describe("#Usage", func() {
		It("returns the usage text of a SlCommand", func() {
			Expect(cmd.Usage()).To(Equal("bmp sl --packages | --package-options"))
		})
	})

	Describe("#Options", func() {
		It("returns the options of a SlCommand", func() {
			Expect(cmds.EqualOptions(cmd.Options(), options)).To(BeTrue())
		})
	})
開發者ID:cloudfoundry-community,項目名稱:bosh-softlayer-tools,代碼行數:29,代碼來源:sl_command_test.go

示例4:

			cmd2 := bmp.NewProvisioningBaremetalCommand(options, fakeBmpClient)
			Expect(cmd2).ToNot(BeNil())
			Expect(cmd2).To(Equal(cmd))
		})
	})

	Describe("#Name", func() {
		It("returns the name of a ProvisioningBaremetalCommand", func() {
			Expect(cmd.Name()).To(Equal("provisioning-baremetal"))
		})
	})

	Describe("#Description", func() {
		It("returns the description of a ProvisioningBaremetalCommand", func() {
			Expect(cmd.Description()).To(Equal(`provisioning a baremetal with specific stemcell, netboot image`))
		})
	})

	Describe("#Usage", func() {
		It("returns the usage text of a ProvisioningBaremetalCommand", func() {
			Expect(cmd.Usage()).To(Equal("bmp provisioning-baremetal --vmprefix <vm-prefix> --stemcell <bm-stemcell> --netbootimage <bm-netboot-image>"))
		})
	})

	Describe("#Options", func() {
		It("returns the options of a ProvisioningBaremetalCommand", func() {
			Expect(cmds.EqualOptions(cmd.Options(), options)).To(BeTrue())
			Expect(cmd.Options().VMPrefix).To(Equal("fake-vmprefix"))
			Expect(cmd.Options().Stemecell).To(Equal("fake-stemcell"))
			Expect(cmd.Options().NetbootImage).To(Equal("fake-netboot-image"))
開發者ID:cloudfoundry-community,項目名稱:bosh-softlayer-tools,代碼行數:30,代碼來源:provisioning_baremetal_command_test.go

示例5:

			cmd2 := bmp.NewCreateBaremetalsCommand(options, fakeBmpClient)
			Expect(cmd2).ToNot(BeNil())
			Expect(cmd2).To(Equal(cmd))
		})
	})

	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 --deployment[-d] <deployment file> [--dryrun]"))
		})
	})

	Describe("#Options", func() {
		It("returns the options of a CreateBaremetalsCommand", func() {
			Expect(cmds.EqualOptions(cmd.Options(), options)).To(BeTrue())
			Expect(cmd.Options().Deployment).ToNot(Equal(""))
			Expect(cmd.Options().Deployment).To(ContainSubstring("test_fixtures/bmp/deployment.yml"))
		})
開發者ID:cloudfoundry-community,項目名稱:bosh-softlayer-tools,代碼行數:30,代碼來源:create_baremetals_command_test.go

示例6:

			cmd2 := bmp.NewTaskCommand(options, fakeBmpClient)
			Expect(cmd2).ToNot(BeNil())
			Expect(cmd2).To(Equal(cmd))
		})
	})

	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; --json, show info with JSON format\"`))
		})
	})

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

	Describe("#Options", func() {
		It("returns the options of a TaskCommand", func() {
			Expect(cmds.EqualOptions(cmd.Options(), options)).To(BeTrue())
			Expect(cmd.Options().TaskID).To(Equal(1))
			Expect(cmd.Options().JSON).To(BeFalse())
			Expect(cmd.Options().Debug).To(BeFalse())
開發者ID:cloudfoundry-community,項目名稱:bosh-softlayer-tools,代碼行數:30,代碼來源:task_command_test.go

示例7:

			cmd2 := bmp.NewUpdateStateCommand(options, fakeBmpClient)
			Expect(cmd2).ToNot(BeNil())
			Expect(cmd2).To(Equal(cmd))
		})
	})

	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 --server <server-id> --state <state>"))
		})
	})

	Describe("#Options", func() {
		It("returns the options of a UpdateStateCommand", func() {
			Expect(cmds.EqualOptions(cmd.Options(), options)).To(BeTrue())
			Expect(cmd.Options().Server).ToNot(Equal(""))
			Expect(cmd.Options().Server).To(Equal("fake-server-id"))
			Expect(cmd.Options().State).ToNot(Equal(""))
開發者ID:cloudfoundry-community,項目名稱:bosh-softlayer-tools,代碼行數:30,代碼來源:update_state_command_test.go

示例8:

			cmd2 := bmp.NewTargetCommand(options, fakeBmpClient)
			Expect(cmd2).ToNot(BeNil())
			Expect(cmd2).To(Equal(cmd))
		})
	})

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

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

	Describe("#Usage", func() {
		It("returns the usage text of a TargetCommand", func() {
			Expect(cmd.Usage()).To(Equal("bmp target http://url.to.bmp.server"))
		})
	})

	Describe("#Options", func() {
		It("returns the options of a TargetCommand", func() {
			Expect(cmds.EqualOptions(cmd.Options(), options)).To(BeTrue())
		})
	})
開發者ID:cloudfoundry-community,項目名稱:bosh-softlayer-tools,代碼行數:29,代碼來源:target_command_test.go

示例9:

			cmd2 := bmp.NewStatusCommand(options, fakeBmpClient)
			Expect(cmd2).ToNot(BeNil())
			Expect(cmd2).To(Equal(cmd))
		})
	})

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

	Describe("#Description", func() {
		It("returns the description of a StatusCommand", func() {
			Expect(cmd.Description()).To(Equal("show bmp status"))
		})
	})

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

	Describe("#Options", func() {
		It("returns the options of a StatusCommand", func() {
			Expect(cmds.EqualOptions(cmd.Options(), options)).To(BeTrue())
		})
	})
開發者ID:cloudfoundry-community,項目名稱:bosh-softlayer-tools,代碼行數:29,代碼來源:status_command_test.go

示例10:

			cmd2 := bmp.NewTasksCommand(options, fakeBmpClient)
			Expect(cmd2).ToNot(BeNil())
			Expect(cmd2).To(Equal(cmd))
		})
	})

	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("#Options", func() {
		It("returns the options of a TasksCommand", func() {
			Expect(cmds.EqualOptions(cmd.Options(), options)).To(BeTrue())
		})
	})
開發者ID:cloudfoundry-community,項目名稱:bosh-softlayer-tools,代碼行數:29,代碼來源:tasks_command_test.go

示例11:

			cmd2 := bmp.NewLoginCommand(options, fakeBmpClient)
			Expect(cmd2).ToNot(BeNil())
			Expect(cmd2).To(Equal(cmd))
		})
	})

	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 --username[-u] <username> --password[-p] <password>"))
		})
	})

	Describe("#Options", func() {
		It("returns the options of a LoginCommand", func() {
			Expect(cmds.EqualOptions(cmd.Options(), options)).To(BeTrue())

			Expect(cmd.Options().Username).ToNot(Equal(""))
			Expect(cmd.Options().Username).To(Equal("fake-username"))
開發者ID:cloudfoundry-community,項目名稱:bosh-softlayer-tools,代碼行數:30,代碼來源:login_command_test.go


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