From 572f6a7fabcf31647bf070c290361c8c13f1a7f1 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Sun, 14 Jun 2020 17:12:20 -0300 Subject: [PATCH] CHANGELOG, docs and nits for #321 and #337 --- CHANGELOG.md | 5 +++++ docs/usage.md | 24 ++++++++++++++++++++++++ testdata/label_status/Taskfile.yml | 2 +- testdata/label_summary/Taskfile.yml | 2 +- testdata/label_uptodate/Taskfile.yml | 2 +- testdata/label_var/Taskfile.yml | 2 +- 6 files changed, 33 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce76f8a1..c93da12b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +# v3.0.0 - Unreleased + +- Add `label:` to task so you can override the task name in the logs + ([#321](https://github.com/go-task/task/issues/321]), [#337](https://github.com/go-task/task/pull/337)). + # v3.0.0 - Preview 4 - Refactor how variables work on version 3 diff --git a/docs/usage.md b/docs/usage.md index 47659001..a5e53570 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -687,6 +687,30 @@ If the task does not have a summary or a description, a warning is printed. Please note: *showing the summary will not execute the command*. +## Overriding task name + +Sometimes you may want to override the task name print on summary, up-to-date +messates to STDOUT, etc. In this case you can just set `label:`, which can also +be interpolated with variables: + +```yaml +version: '3' + +tasks: + default: + - task: print + vars: + MESSAGE: hello + - task: print + vars: + MESSAGE: world + + print: + label: 'print-{{.MESSAGE}}' + cmds: + - echo "{{.MESSAGE}}" +``` + ## Silent mode Silent mode disables echoing of commands before Task runs it. diff --git a/testdata/label_status/Taskfile.yml b/testdata/label_status/Taskfile.yml index 79747464..e4bc0a33 100644 --- a/testdata/label_status/Taskfile.yml +++ b/testdata/label_status/Taskfile.yml @@ -4,4 +4,4 @@ tasks: foo: label: "foobar" status: - - "false" \ No newline at end of file + - "false" diff --git a/testdata/label_summary/Taskfile.yml b/testdata/label_summary/Taskfile.yml index c649c09f..29c96fca 100644 --- a/testdata/label_summary/Taskfile.yml +++ b/testdata/label_summary/Taskfile.yml @@ -5,4 +5,4 @@ tasks: label: "foobar" desc: description status: - - echo "I'm ok" \ No newline at end of file + - echo "I'm ok" diff --git a/testdata/label_uptodate/Taskfile.yml b/testdata/label_uptodate/Taskfile.yml index 2219f4a6..3cc457bd 100644 --- a/testdata/label_uptodate/Taskfile.yml +++ b/testdata/label_uptodate/Taskfile.yml @@ -4,4 +4,4 @@ tasks: foo: label: "foobar" status: - - echo "I'm ok" \ No newline at end of file + - echo "I'm ok" diff --git a/testdata/label_var/Taskfile.yml b/testdata/label_var/Taskfile.yml index b47a76ac..63c45cbf 100644 --- a/testdata/label_var/Taskfile.yml +++ b/testdata/label_var/Taskfile.yml @@ -7,4 +7,4 @@ tasks: foo: label: "foo{{.BAR}}" status: - - echo "I'm ok" \ No newline at end of file + - echo "I'm ok"