From 413dcd28a880117296c0e47eccd36b266dc840bf Mon Sep 17 00:00:00 2001 From: Vincent Smith Date: Fri, 28 Jun 2024 12:13:52 -0400 Subject: [PATCH] Add verbose/silent variables (#1669) --- cmd/task/task.go | 2 ++ website/versioned_docs/version-latest/api_reference.mdx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cmd/task/task.go b/cmd/task/task.go index 8ee98236..5969c840 100644 --- a/cmd/task/task.go +++ b/cmd/task/task.go @@ -180,6 +180,8 @@ func run() error { globals.Set("CLI_ARGS", ast.Var{Value: cliArgs}) globals.Set("CLI_FORCE", ast.Var{Value: flags.Force || flags.ForceAll}) + globals.Set("CLI_SILENT", ast.Var{Value: flags.Silent}) + globals.Set("CLI_VERBOSE", ast.Var{Value: flags.Verbose}) e.Taskfile.Vars.Merge(globals, nil) if !flags.Watch { diff --git a/website/versioned_docs/version-latest/api_reference.mdx b/website/versioned_docs/version-latest/api_reference.mdx index 43f7ff49..8535a7a3 100644 --- a/website/versioned_docs/version-latest/api_reference.mdx +++ b/website/versioned_docs/version-latest/api_reference.mdx @@ -127,6 +127,8 @@ There are some special variables that is available on the templating system: | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | `CLI_ARGS` | Contain all extra arguments passed after `--` when calling Task through the CLI. | | `CLI_FORCE` | A boolean containing whether the `--force` or `--force-all` flags were set. | +| `CLI_SILENT` | A boolean containing whether the `--silent` flag was set. | +| `CLI_VERBOSE` | A boolean containing whether the `--verbose` flag was set. | | `TASK` | The name of the current task. | | `ROOT_TASKFILE` | The absolute path of the root Taskfile. | | `ROOT_DIR` | The absolute path of the root Taskfile directory. |