MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / NewCmdSet

Function NewCmdSet

pkg/cmd/config/set/set.go:17–36  ·  view source on GitHub ↗
(f factory.Factory)

Source from the content-addressed store, hash-verified

15)
16
17func NewCmdSet(f factory.Factory) *cobra.Command {
18 cmd := &cobra.Command{
19 Use: "set [key] [value]",
20 Short: "Set will write the value for given key to Octopus CLI config file",
21 Long: "Set will write the value for given key to Octopus CLI config file.",
22 RunE: func(_ *cobra.Command, args []string) error {
23 key := ""
24 value := ""
25 if len(args) > 0 {
26 key = args[0]
27 if len(args) > 1 {
28 value = args[1]
29 }
30 }
31 return setRun(f.IsPromptEnabled(), f.Ask, key, value)
32
33 },
34 }
35 return cmd
36}
37
38func setRun(isPromptEnabled bool, ask question.Asker, key string, value string) error {
39 // have to make new viper so it only contains file value, no ENVs or Flags

Callers

nothing calls this directly

Calls 2

setRunFunction · 0.85
IsPromptEnabledMethod · 0.65

Tested by

no test coverage detected