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

Function NewCmdCreate

pkg/cmd/projectgroup/create/create.go:71–92  ·  view source on GitHub ↗
(f factory.Factory)

Source from the content-addressed store, hash-verified

69}
70
71func NewCmdCreate(f factory.Factory) *cobra.Command {
72 optFlags := NewCreateFlags()
73 cmd := &cobra.Command{
74 Use: "create",
75 Short: "Create a project group",
76 Long: "Create a project group in Octopus Deploy",
77 Example: heredoc.Docf("%s project-group create", constants.ExecutableName),
78 Aliases: []string{"new"},
79 RunE: func(c *cobra.Command, _ []string) error {
80 opts := NewCreateOptions(optFlags, cmd.NewDependencies(f, c))
81
82 return createRun(opts)
83 },
84 }
85
86 flags := cmd.Flags()
87 flags.StringVarP(&optFlags.Name.Value, optFlags.Name.Name, "n", "", "Name of the project group")
88 flags.StringVarP(&optFlags.Description.Value, optFlags.Description.Name, "d", "", "Description of the project group")
89 flags.SortFlags = false
90
91 return cmd
92}
93
94func createRun(opts *CreateOptions) error {
95 if !opts.NoPrompt {

Callers

nothing calls this directly

Calls 3

NewCreateFlagsFunction · 0.70
NewCreateOptionsFunction · 0.70
createRunFunction · 0.70

Tested by

no test coverage detected