1
0
mirror of https://github.com/go-task/task.git synced 2025-08-10 22:42:19 +02:00

add silent mode to disable echoing of commands

This commit is contained in:
Andrey Nering
2017-07-19 20:20:24 -03:00
parent dc6cb68327
commit d0b37df615
5 changed files with 82 additions and 8 deletions

View File

@@ -19,6 +19,7 @@ It aims to be simpler and easier to use then [GNU Make][make].
- [Dynamic variables](#dynamic-variables)
- [Go's template engine](#gos-template-engine)
- [Help](#help)
- [Silent mode](#silent-mode)
- [Watch tasks](#watch-tasks-experimental)
- [Alternative task runners](#alternative-task-runners)
@@ -421,6 +422,60 @@ would print the following output:
* test: Run all the go tests.
```
## Silent mode
Silent mode disables echoing of commands before Task runs it.
For the following Taskfile:
```yml
echo:
cmds:
- echo "Print something"
```
Normally this will be print:
```sh
echo "Print something"
Print something
```
With silent mode on, the below will be print instead:
```sh
Print something
```
There's three ways to enable silent mode:
* At command level:
```yml
echo:
cmds:
- cmd: echo "Print something"
silent: true
```
* At task level:
```yml
echo:
cmds:
- echo "Print something"
silent: true
```
* Or globally with `--silent` or `-s` flag
If you want to supress stdout instead, just redirect a command to `/dev/null`:
```yml
echo:
cmds:
- echo "This will print nothing" > /dev/null
```
## Watch tasks (experimental)
If you give a `--watch` or `-w` argument, task will watch for files changes