MCPcopy Create free account
hub / github.com/cloudfoundry/multiapps-cli-plugin / Run

Method Run

multiapps_plugin.go:37–58  ·  view source on GitHub ↗

Run runs this plugin

(cliConnection plugin.CliConnection, args []string)

Source from the content-addressed store, hash-verified

35
36// Run runs this plugin
37func (p *MultiappsPlugin) Run(cliConnection plugin.CliConnection, args []string) {
38 disableStdOut()
39 if args[0] == "CLI-MESSAGE-UNINSTALL" {
40 return
41 }
42 command, err := findCommand(args[0])
43 if err != nil {
44 log.Fatalln(err)
45 }
46 versionOutput, err := cliConnection.CliCommandWithoutTerminalOutput("version")
47 if err != nil {
48 log.Traceln(err)
49 versionOutput = []string{util.DefaultCliVersion}
50 }
51 util.SetCfCliVersion(strings.Join(versionOutput, " "))
52 util.SetPluginVersion(Version)
53 command.Initialize(command.GetPluginCommand().Name, cliConnection)
54 status := command.Execute(args[1:])
55 if status == commands.Failure {
56 os.Exit(1)
57 }
58}
59
60// GetMetadata returns the metadata of this plugin
61func (p *MultiappsPlugin) GetMetadata() plugin.PluginMetadata {

Callers

nothing calls this directly

Calls 10

FatallnFunction · 0.92
TracelnFunction · 0.92
SetCfCliVersionFunction · 0.92
SetPluginVersionFunction · 0.92
disableStdOutFunction · 0.85
findCommandFunction · 0.85
InitializeMethod · 0.65
GetPluginCommandMethod · 0.65
ExecuteMethod · 0.65
ExitMethod · 0.65

Tested by

no test coverage detected