(deps commandDeps)
| 2494 | } |
| 2495 | |
| 2496 | func newTaskRunStartCommand(deps commandDeps) *cobra.Command { |
| 2497 | var idempotencyKey string |
| 2498 | |
| 2499 | cmd := &cobra.Command{ |
| 2500 | Use: "start <run-id>", |
| 2501 | Short: "Start a claimed task run", |
| 2502 | Args: exactOneNonBlankArg(), |
| 2503 | RunE: func(cmd *cobra.Command, args []string) error { |
| 2504 | client, err := clientFromDeps(deps) |
| 2505 | if err != nil { |
| 2506 | return err |
| 2507 | } |
| 2508 | |
| 2509 | run, err := client.StartTaskRun(cmd.Context(), args[0], StartTaskRunRequest{ |
| 2510 | IdempotencyKey: strings.TrimSpace(idempotencyKey), |
| 2511 | }) |
| 2512 | if err != nil { |
| 2513 | return err |
| 2514 | } |
| 2515 | return writeCommandOutput(cmd, taskRunBundle(run)) |
| 2516 | }, |
| 2517 | } |
| 2518 | cmd.Flags().StringVar(&idempotencyKey, "idempotency-key", "", "Optional idempotency key") |
| 2519 | return cmd |
| 2520 | } |
| 2521 | |
| 2522 | func newTaskRunAttachSessionCommand(deps commandDeps) *cobra.Command { |
| 2523 | var sessionID string |
no test coverage detected