func (cmd *HelpCommand) Setup(config commands.Config, ui commands.UI) error { cmd.Actor = v2actions.NewActor(nil) cmd.Config = config cmd.UI = ui return nil }
func (cmd UnbindServiceCommand) Setup(config commands.Config, ui commands.UI) error { cmd.UI = ui cmd.Config = config client, err := common.NewCloudControllerClient(config) if err != nil { return err } cmd.Actor = v2actions.NewActor(client) return nil }
func (cmd *DeleteOrphanedRoutesCommand) Setup(config commands.Config, ui commands.UI) error { cmd.UI = ui cmd.Config = config client, err := common.NewCloudControllerClient(config) if err != nil { return err } cmd.Actor = v2actions.NewActor(client) return nil }
Expect(fakeUI.Out).To(Say("faceman diego-enabler this and that and a little stuff")) Expect(fakeUI.Out).To(Say("ALIAS:")) Expect(fakeUI.Out).To(Say("ed")) Expect(fakeUI.Out).To(Say("--first\\s+foobar")) Expect(fakeUI.Out).To(Say("--second-third\\s+baz")) }) }) }) Describe("help for common commands", func() { BeforeEach(func() { cmd.OptionalArgs = flags.CommandName{ CommandName: "", } cmd.AllCommands = false cmd.Actor = v2actions.NewActor(nil) }) It("returns a list of only the common commands", func() { err := cmd.Execute(nil) Expect(err).ToNot(HaveOccurred()) Expect(fakeUI.Out).To(Say("faceman version BUILT_FROM_SOURCE-BUILT_AT_UNKNOWN_TIME, Cloud Foundry command line tool")) Expect(fakeUI.Out).To(Say("Usage: faceman \\[global options\\] command \\[arguments...\\] \\[command options\\]")) Expect(fakeUI.Out).To(Say("Before getting started:")) Expect(fakeUI.Out).To(Say("help,h\\s+logout,lo")) Expect(fakeUI.Out).To(Say("Application lifecycle:")) Expect(fakeUI.Out).To(Say("apps,a\\s+logs\\s+set-env,se"))