outputGet routes to the appropriate formatter.
(task *model.Task, deps dependencyInfo, ctxFiles []taskcontext.FileEntry, wl *worklogInfo, format string)
| 391 | |
| 392 | // outputGet routes to the appropriate formatter. |
| 393 | func outputGet(task *model.Task, deps dependencyInfo, ctxFiles []taskcontext.FileEntry, wl *worklogInfo, format string) error { |
| 394 | switch format { |
| 395 | case "text": |
| 396 | return outputGetText(task, deps, ctxFiles, wl, os.Stdout) |
| 397 | case "json": |
| 398 | return outputGetJSON(task, deps, ctxFiles, wl, os.Stdout) |
| 399 | case "yaml": |
| 400 | return outputGetYAML(task, deps, ctxFiles, wl, os.Stdout) |
| 401 | default: |
| 402 | return fmt.Errorf("unsupported format: %s (supported: text, json, yaml)", format) |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | func outputGetText(task *model.Task, deps dependencyInfo, ctxFiles []taskcontext.FileEntry, wl *worklogInfo, w io.Writer) error { |
| 407 | r := getRenderer() |
no test coverage detected