MCPcopy
hub / github.com/cloudfoundry/cli / WriteCommand

Function WriteCommand

integration/helpers/command.go:104–124  ·  view source on GitHub ↗

WriteCommand prints the working directory, the environment variables, and 'cf' with the given arguments. Environment variables that are passwords will be redacted.

(workingDir string, env map[string]string, args []string)

Source from the content-addressed store, hash-verified

102// 'cf' with the given arguments. Environment variables that are passwords will
103// be redacted.
104func WriteCommand(workingDir string, env map[string]string, args []string) {
105 start := DebugCommandPrefix
106 if workingDir != "" {
107 start = fmt.Sprintf(DebugCommandPrefixWithDir, workingDir)
108 }
109
110 display := []string{
111 start,
112 }
113
114 for key, val := range env {
115 if isPass.MatchString(key) {
116 val = "*****"
117 }
118 display = append(display, fmt.Sprintf("%s=%s", key, val))
119 }
120
121 display = append(display, "cf")
122 display = append(display, args...)
123 GinkgoWriter.Write([]byte(strings.Join(append(display, "\n"), " ")))
124}

Callers 3

CFFunction · 0.85
CustomCFFunction · 0.85
CFWithStdinFunction · 0.85

Calls 1

WriteMethod · 0.80

Tested by

no test coverage detected