(deps commandDeps)
| 1520 | } |
| 1521 | |
| 1522 | func newTaskBlocksCommand(deps commandDeps) *cobra.Command { |
| 1523 | var includeCleared bool |
| 1524 | cmd := &cobra.Command{ |
| 1525 | Use: "blocks <id>", |
| 1526 | Short: "List task blocks", |
| 1527 | Args: exactOneNonBlankArg(), |
| 1528 | RunE: func(cmd *cobra.Command, args []string) error { |
| 1529 | client, err := clientFromDeps(deps) |
| 1530 | if err != nil { |
| 1531 | return err |
| 1532 | } |
| 1533 | blocks, err := client.ListTaskBlocks(cmd.Context(), args[0], includeCleared) |
| 1534 | if err != nil { |
| 1535 | return err |
| 1536 | } |
| 1537 | return writeCommandOutput(cmd, taskBlockListBundle(blocks)) |
| 1538 | }, |
| 1539 | } |
| 1540 | cmd.Flags().BoolVar(&includeCleared, "all", false, "Include cleared blocks") |
| 1541 | return cmd |
| 1542 | } |
| 1543 | |
| 1544 | func newTaskRecoverCommand(deps commandDeps) *cobra.Command { |
| 1545 | var note string |
no test coverage detected