(f factory.Factory)
| 25 | } |
| 26 | |
| 27 | func NewCmdEnable(f factory.Factory) *cobra.Command { |
| 28 | cmd := &cobra.Command{ |
| 29 | Use: "enable {<name> | <id>}", |
| 30 | Short: "Enable a tenant", |
| 31 | Long: "Enable a tenant in Octopus Deploy", |
| 32 | Example: heredoc.Docf(` |
| 33 | %[1]s tenant enable Tenants-1 |
| 34 | %[1]s tenant enable 'Tenant' |
| 35 | `, constants.ExecutableName), |
| 36 | RunE: func(c *cobra.Command, args []string) error { |
| 37 | if len(args) == 0 { |
| 38 | args = append(args, "") |
| 39 | } |
| 40 | |
| 41 | opts := NewEnableOptions(args, cmd.NewDependencies(f, c)) |
| 42 | return enableRun(opts) |
| 43 | }, |
| 44 | } |
| 45 | |
| 46 | return cmd |
| 47 | } |
| 48 | |
| 49 | func enableRun(opts *EnableOptions) error { |
| 50 | if !opts.NoPrompt { |
nothing calls this directly
no test coverage detected