(deps commandDeps)
| 1276 | } |
| 1277 | |
| 1278 | func newTaskRejectCommand(deps commandDeps) *cobra.Command { |
| 1279 | cmd := &cobra.Command{ |
| 1280 | Use: "reject <id>", |
| 1281 | Short: "Reject a pending approval task", |
| 1282 | Args: exactOneNonBlankArg(), |
| 1283 | RunE: func(cmd *cobra.Command, args []string) error { |
| 1284 | client, err := clientFromDeps(deps) |
| 1285 | if err != nil { |
| 1286 | return err |
| 1287 | } |
| 1288 | rejected, err := client.RejectTask(cmd.Context(), args[0]) |
| 1289 | if err != nil { |
| 1290 | return err |
| 1291 | } |
| 1292 | return writeCommandOutput(cmd, taskBundle(&rejected)) |
| 1293 | }, |
| 1294 | } |
| 1295 | return cmd |
| 1296 | } |
| 1297 | |
| 1298 | func newTaskExecutionCommand( |
| 1299 | deps commandDeps, |
no test coverage detected