MCPcopy
hub / github.com/cortexlabs/cortex / envStringIfNotSpecified

Function envStringIfNotSpecified

cli/cmd/root.go:225–236  ·  view source on GitHub ↗
(envName string, cmd *cobra.Command)

Source from the content-addressed store, hash-verified

223}
224
225func envStringIfNotSpecified(envName string, cmd *cobra.Command) (string, error) {
226 envNames, err := listConfiguredEnvNames()
227 if err != nil {
228 return "", err
229 }
230
231 if _flagOutput == flags.PrettyOutputType && !wasFlagProvided(cmd, "env") && len(envNames) > 1 {
232 return fmt.Sprintf("using %s environment\n\n", envName), nil
233 }
234
235 return "", nil
236}

Callers 3

printEnvIfNotSpecifiedFunction · 0.85
describe.goFile · 0.85
get.goFile · 0.85

Calls 2

listConfiguredEnvNamesFunction · 0.85
wasFlagProvidedFunction · 0.85

Tested by

no test coverage detected