From e323a433174beed881861f11cf4da9f5872c12a9 Mon Sep 17 00:00:00 2001 From: Andriy Oblivantsev Date: Tue, 22 Sep 2026 14:34:40 +0100 Subject: [PATCH] feat(oo): projects milestone-delete --- cmd/oo/projects.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/cmd/oo/projects.go b/cmd/oo/projects.go index 52004e2..9190721 100644 --- a/cmd/oo/projects.go +++ b/cmd/oo/projects.go @@ -24,6 +24,7 @@ func init() { projectsCmd.AddCommand(prjGetCmd()) projectsCmd.AddCommand(prjMilestonesCmd()) projectsCmd.AddCommand(prjMilestoneCreateCmd()) + projectsCmd.AddCommand(prjMilestoneDeleteCmd()) projectsCmd.AddCommand(prjCreateCmd()) projectsCmd.AddCommand(prjUpdateCmd()) projectsCmd.AddCommand(prjDeleteCmd()) @@ -297,6 +298,32 @@ func prjMilestoneCreateCmd() *cobra.Command { return cmd } +func prjMilestoneDeleteCmd() *cobra.Command { + return &cobra.Command{ + Use: "milestone-delete MILESTONE_ID [MILESTONE_ID...]", + Aliases: []string{"milestone-rm"}, + Short: "Delete project milestone(s) by id", + Args: cobra.MinimumNArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + c, err := newOO(cmd) + if err != nil { + return err + } + for _, raw := range args { + id, err := strconv.ParseInt(raw, 10, 64) + if err != nil { + return fmt.Errorf("milestone id %q must be integer: %w", raw, err) + } + if err := c.DeleteMilestone(id); err != nil { + return fmt.Errorf("delete milestone %d: %w", id, err) + } + printObject(map[string]any{"milestone_id": id, "deleted": true}) + } + return nil + }, + } +} + func prjCreateCmd() *cobra.Command { var desc, resp string var country, company string