Documentation
¶
Overview ¶
cmd/project/labels/create/create.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CreateCmd = &cobra.Command{ Use: "create --name <label-name>", Short: "Create a new label in the repository.", Example: ` contextvibes project labels create --name "docs" --description "Documentation updates" --color "0075ca"`, RunE: func(cmd *cobra.Command, args []string) error { presenter := ui.NewPresenter(cmd.OutOrStdout(), cmd.ErrOrStderr()) ctx := cmd.Context() if strings.TrimSpace(labelName) == "" { return errors.New("label name cannot be empty, please provide the --name flag") } provider, err := newProvider(ctx, globals.AppLogger, globals.LoadedAppConfig) if err != nil { presenter.Error("Failed to initialize work item provider: %v", err) return err } newLabel := workitem.Label{ Name: labelName, Description: labelDescription, Color: labelColor, } presenter.Summary("Creating label '%s'...", newLabel.Name) _, err = provider.CreateLabel(ctx, newLabel) if err != nil { presenter.Error("Failed to create label: %v", err) return err } presenter.Success("Successfully created label '%s'.", newLabel.Name) return nil }, }
CreateCmd represents the project labels create command.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.