(deps commandDeps)
| 1542 | } |
| 1543 | |
| 1544 | func newTaskRecoverCommand(deps commandDeps) *cobra.Command { |
| 1545 | var note string |
| 1546 | cmd := &cobra.Command{ |
| 1547 | Use: "recover <id>", |
| 1548 | Short: "Recover a task from needs_attention", |
| 1549 | Args: exactOneNonBlankArg(), |
| 1550 | RunE: func(cmd *cobra.Command, args []string) error { |
| 1551 | client, err := clientFromDeps(deps) |
| 1552 | if err != nil { |
| 1553 | return err |
| 1554 | } |
| 1555 | recovered, err := client.RecoverTask( |
| 1556 | cmd.Context(), |
| 1557 | args[0], |
| 1558 | RecoverTaskRequest{Note: strings.TrimSpace(note)}, |
| 1559 | ) |
| 1560 | if err != nil { |
| 1561 | return err |
| 1562 | } |
| 1563 | return writeCommandOutput(cmd, taskBundle(&recovered)) |
| 1564 | }, |
| 1565 | } |
| 1566 | cmd.Flags().StringVar(¬e, "note", "", "Optional recovery note") |
| 1567 | return cmd |
| 1568 | } |
| 1569 | |
| 1570 | func newTaskNextCommand(deps commandDeps) *cobra.Command { |
| 1571 | var ( |
no test coverage detected