1
0
mirror of https://github.com/go-task/task.git synced 2025-06-06 23:46:46 +02:00

docs: describe how to use the silent flag for dependencies (#680)

This commit is contained in:
Mads H. Danquah 2023-04-30 13:26:27 +02:00 committed by Andrey Nering
parent 8bc98fedbf
commit e01b5565a2
3 changed files with 9 additions and 2 deletions

View File

@ -280,6 +280,7 @@ tasks:
| --------- | ---------------------------------- | ------- | -------------------------------------------------------- | | --------- | ---------------------------------- | ------- | -------------------------------------------------------- |
| `task` | `string` | | The task to be execute as a dependency. | | `task` | `string` | | The task to be execute as a dependency. |
| `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to this task. | | `vars` | [`map[string]Variable`](#variable) | | Optional additional variables to be passed to this task. |
| `silent` | `bool` | `false` | Hides task name and command from output. The command's output will still be redirected to `STDOUT` and `STDERR`. |
:::tip :::tip

View File

@ -468,6 +468,7 @@ tasks:
vars: { TEXT: 'before 1' } vars: { TEXT: 'before 1' }
- task: echo_sth - task: echo_sth
vars: { TEXT: 'before 2' } vars: { TEXT: 'before 2' }
silent: true
cmds: cmds:
- echo "after" - echo "after"
@ -574,8 +575,8 @@ tasks:
- echo "Another task" - echo "Another task"
``` ```
Overriding variables in the called task is as simple as informing `vars` Using the `vars` and `silent` attributes you can choose to pass variables and
attribute: toggle [silent mode](#silent-mode) on a call-by-call basis:
```yaml ```yaml
version: '3' version: '3'
@ -591,6 +592,7 @@ tasks:
cmds: cmds:
- task: greet - task: greet
vars: { RECIPIENT: 'Cruel World' } vars: { RECIPIENT: 'Cruel World' }
silent: true
``` ```
The above syntax is also supported in `deps`. The above syntax is also supported in `deps`.

View File

@ -241,6 +241,10 @@
"vars": { "vars": {
"description": "Values passed to the task called", "description": "Values passed to the task called",
"$ref": "#/definitions/3/vars" "$ref": "#/definitions/3/vars"
},
"silent": {
"description": "Hides task name and command from output. The command's output will still be redirected to `STDOUT` and `STDERR`.",
"type": "boolean"
} }
} }
}, },