Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions internal/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ func init() {
pflag.BoolVarP(&ExitCode, "exit-code", "x", false, "Pass-through the exit code of the task command.")
pflag.StringVarP(&Dir, "dir", "d", "", "Sets the directory in which Task will execute and look for a Taskfile.")
pflag.StringVarP(&Entrypoint, "taskfile", "t", "", `Choose which Taskfile to run. Defaults to "Taskfile.yml".`)
pflag.StringVarP(&Output.Name, "output", "o", "", "Sets output style: [interleaved|group|prefixed].")
pflag.StringVar(&Output.Group.Begin, "output-group-begin", "", "Message template to print before a task's grouped output.")
pflag.StringVar(&Output.Group.End, "output-group-end", "", "Message template to print after a task's grouped output.")
pflag.BoolVar(&Output.Group.ErrorOnly, "output-group-error-only", false, "Swallow output from successful tasks.")
pflag.StringVarP(&Output.Name, "output", "o", getConfig(config, "OUTPUT", func() *string { return nil }, ""), "Sets output style: [interleaved|group|prefixed].")
pflag.StringVar(&Output.Group.Begin, "output-group-begin", getConfig(config, "OUTPUT_GROUP_BEGIN", func() *string { return nil }, ""), "Message template to print before a task's grouped output.")
pflag.StringVar(&Output.Group.End, "output-group-end", getConfig(config, "OUTPUT_GROUP_END", func() *string { return nil }, ""), "Message template to print after a task's grouped output.")
pflag.BoolVar(&Output.Group.ErrorOnly, "output-group-error-only", getConfig(config, "OUTPUT_GROUP_ERROR_ONLY", func() *bool { return nil }, false), "Swallow output from successful tasks.")
pflag.BoolVarP(&Color, "color", "c", getConfig(config, "COLOR", func() *bool { return config.Color }, true), "Colored output. Enabled by default. Set flag to false or use NO_COLOR=1 to disable.")
pflag.IntVarP(&Concurrency, "concurrency", "C", getConfig(config, "CONCURRENCY", func() *int { return config.Concurrency }, 0), "Limit number of tasks to run concurrently.")
pflag.DurationVarP(&Interval, "interval", "I", 0, "Interval to watch for changes.")
Expand Down
8 changes: 8 additions & 0 deletions website/src/docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ task backup --global

Set output style. Available modes: `interleaved`, `group`, `prefixed`.

- **Environment variable**: [`TASK_OUTPUT`](./environment.md#task-output)

```bash
task test --output group
```
Expand All @@ -234,6 +236,8 @@ task test --output group

Message template to print before grouped output.

- **Environment variable**: [`TASK_OUTPUT_GROUP_BEGIN`](./environment.md#task-output-group-begin)

```bash
task test --output group --output-group-begin "::group::{{.TASK}}"
```
Expand All @@ -242,6 +246,8 @@ task test --output group --output-group-begin "::group::{{.TASK}}"

Message template to print after grouped output.

- **Environment variable**: [`TASK_OUTPUT_GROUP_END`](./environment.md#task-output-group-end)

```bash
task test --output group --output-group-end "::endgroup::"
```
Expand All @@ -250,6 +256,8 @@ task test --output group --output-group-end "::endgroup::"

Only show command output on non-zero exit codes.

- **Environment variable**: [`TASK_OUTPUT_GROUP_ERROR_ONLY`](./environment.md#task-output-group-error-only)

```bash
task test --output group --output-group-error-only
```
Expand Down
28 changes: 28 additions & 0 deletions website/src/docs/reference/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,34 @@ variables. The priority order is: CLI flags > environment variables > config fil
- **Default**: `false`
- **Description**: Prompt for missing required variables

### `TASK_OUTPUT`

- **Type**: `string` (`interleaved`, `group`, `prefixed`)
- **Description**: Sets the output style
- **CLI equivalent**: [`--output`](./cli.md#--output-string)

### `TASK_OUTPUT_GROUP_BEGIN`

- **Type**: `string`
- **Description**: Message template to print before a task's grouped output.
Only applies when the output style is `group`.
- **CLI equivalent**: [`--output-group-begin`](./cli.md#--output-group-begin-template)

### `TASK_OUTPUT_GROUP_END`

- **Type**: `string`
- **Description**: Message template to print after a task's grouped output.
Only applies when the output style is `group`.
- **CLI equivalent**: [`--output-group-end`](./cli.md#--output-group-end-template)

### `TASK_OUTPUT_GROUP_ERROR_ONLY`

- **Type**: `boolean` (`true`, `false`, `1`, `0`)
- **Default**: `false`
- **Description**: Swallow output from successful tasks. Only applies when the
output style is `group`.
- **CLI equivalent**: [`--output-group-error-only`](./cli.md#--output-group-error-only)

### `TASK_TEMP_DIR`

Defines the location of Task's temporary directory which is used for storing
Expand Down
Loading