import type { Command } from "commander"; import { type UpdateMilestoneOptions, updateMilestone, } from "../../../commands/milestone"; import { addWorkspaceOption, resolveTextInput, strict } from "../../helpers"; export function registerMilestoneUpdate(parent: Command): void { strict(addWorkspaceOption(parent.command("update"))) .description("Update milestone") .argument("") .option("--name ", "New name") .option("--description ", "New description") .option("--description-file ", "Read new description from file") .option("--targetDate ", "New target date") .option("--json", "Output as JSON") .action(async (id: string, options) => { const description = await resolveTextInput({ value: options.description, file: options.descriptionFile, valueFlag: "--description", fileFlag: "--description-file", }); const opts: UpdateMilestoneOptions = { id, name: options.name, description, targetDate: options.targetDate, json: options.json, }; await updateMilestone(opts); }); }