mirror of
https://github.com/go-task/task.git
synced 2026-07-01 00:24:30 +00:00
feat: configure output flags via environment variables (#2873)
Co-authored-by: Or Carmi <ocarmi@paloaltonetworks.com> Co-authored-by: Valentin Maerten <maerten.valentin@gmail.com>
This commit is contained in:
@@ -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
|
||||
```
|
||||
@@ -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}}"
|
||||
```
|
||||
@@ -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::"
|
||||
```
|
||||
@@ -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
|
||||
```
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user