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

Function NewIncludeVariableSetCmd

pkg/cmd/project/variables/include/include.go:61–83  ·  view source on GitHub ↗
(f factory.Factory)

Source from the content-addressed store, hash-verified

59}
60
61func NewIncludeVariableSetCmd(f factory.Factory) *cobra.Command {
62 createFlags := NewIncludeVariableSetFlags()
63 cmd := &cobra.Command{
64 Use: "include",
65 Short: "Include a variable set in a project",
66 Long: "Include a variable set in a project in Octopus Deploy",
67 Example: heredoc.Docf(`
68 %[1]s project variable include
69 %[1]s project variable include --variable-set "Slack Variables"
70 `, constants.ExecutableName),
71 RunE: func(c *cobra.Command, args []string) error {
72 opts := NewIncludeOptions(createFlags, cmd.NewDependencies(f, c))
73
74 return includeRun(opts)
75 },
76 }
77
78 flags := cmd.Flags()
79 flags.StringVarP(&createFlags.Project.Value, createFlags.Project.Name, "p", "", "The project")
80 flags.StringArrayVarP(&createFlags.VariableSets.Value, createFlags.VariableSets.Name, "", []string{}, "The name of the library variable set")
81
82 return cmd
83}
84
85func includeRun(opts *IncludeOptions) error {
86 if !opts.NoPrompt {

Callers

nothing calls this directly

Calls 3

NewIncludeOptionsFunction · 0.85
includeRunFunction · 0.85

Tested by

no test coverage detected