(f factory.Factory)
| 59 | } |
| 60 | |
| 61 | func 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 | |
| 85 | func includeRun(opts *IncludeOptions) error { |
| 86 | if !opts.NoPrompt { |
nothing calls this directly
no test coverage detected