Skip to content

Commit 413dcd2

Browse files
authored
Add verbose/silent variables (#1669)
1 parent da6f5c6 commit 413dcd2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

cmd/task/task.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ func run() error {
180180

181181
globals.Set("CLI_ARGS", ast.Var{Value: cliArgs})
182182
globals.Set("CLI_FORCE", ast.Var{Value: flags.Force || flags.ForceAll})
183+
globals.Set("CLI_SILENT", ast.Var{Value: flags.Silent})
184+
globals.Set("CLI_VERBOSE", ast.Var{Value: flags.Verbose})
183185
e.Taskfile.Vars.Merge(globals, nil)
184186

185187
if !flags.Watch {

website/versioned_docs/version-latest/api_reference.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ There are some special variables that is available on the templating system:
127127
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
128128
| `CLI_ARGS` | Contain all extra arguments passed after `--` when calling Task through the CLI. |
129129
| `CLI_FORCE` | A boolean containing whether the `--force` or `--force-all` flags were set. |
130+
| `CLI_SILENT` | A boolean containing whether the `--silent` flag was set. |
131+
| `CLI_VERBOSE` | A boolean containing whether the `--verbose` flag was set. |
130132
| `TASK` | The name of the current task. |
131133
| `ROOT_TASKFILE` | The absolute path of the root Taskfile. |
132134
| `ROOT_DIR` | The absolute path of the root Taskfile directory. |

0 commit comments

Comments
 (0)