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

Function NewExcludeVariableSetCmd

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

Source from the content-addressed store, hash-verified

59}
60
61func NewExcludeVariableSetCmd(f factory.Factory) *cobra.Command {
62 createFlags := NewExcludeVariableSetFlags()
63 cmd := &cobra.Command{
64 Use: "exclude",
65 Short: "Exclude a variable set from a project",
66 Long: "Exclude a variable set from a project in Octopus Deploy",
67 Example: heredoc.Docf(`
68 %[1]s project variable exclude
69 %[1]s project variable exclude --variable-set "Slack Variables"
70 `, constants.ExecutableName),
71 RunE: func(c *cobra.Command, args []string) error {
72 opts := NewExcludeOptions(createFlags, cmd.NewDependencies(f, c))
73
74 return excludeRun(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 excludeRun(opts *ExcludeOptions) error {
86 if !opts.NoPrompt {

Callers

nothing calls this directly

Calls 3

NewExcludeOptionsFunction · 0.85
excludeRunFunction · 0.85

Tested by

no test coverage detected