@@ -1682,36 +1682,45 @@ clear what they contain:
16821682version: '3'
16831683
16841684tasks:
1685- echo- *:
1685+ start:*: *:
16861686 vars:
1687- TEXT: '{{index .MATCH 0}}'
1687+ SERVICE: "{{index .MATCH 0}}"
1688+ REPLICAS: "{{index .MATCH 1}}"
16881689 cmds:
1689- - echo {{.TEXT}}
1690+ - echo "Starting {{.SERVICE}} with {{.REPLICAS}} replicas"
16901691
1691- run-*- *:
1692+ start: *:
16921693 vars:
1693- ARG_1: '{{index .MATCH 0}}'
1694- ARG_2: '{{index .MATCH 1}}'
1694+ SERVICE: "{{index .MATCH 0}}"
16951695 cmds:
1696- - echo {{.ARG_1}} {{.ARG_2}}
1696+ - echo "Starting {{.SERVICE}}"
1697+ ` ` `
1698+
1699+ This call matches the `start:*` task and the string "foo" is captured by the
1700+ wildcard and stored in the `.MATCH` variable. We then index the `.MATCH` array
1701+ and store the result in the `.SERVICE` variable which is then echoed out in the
1702+ cmds :
1703+
1704+ ` ` ` shell
1705+ $ task start:foo
1706+ Starting foo
16971707` ` `
16981708
1709+ You can use whitespace in your arguments as long as you quote the task name :
1710+
16991711` ` ` shell
1700- # This call matches the "echo-*" task and the string "hello" is captured by the
1701- # wildcard and stored in the .MATCH variable. We then index the .MATCH array and
1702- # store the result in the .TEXT variable which is then echoed out in the cmds.
1703- $ task echo-hello
1704- hello
1705- # You can use whitespace in your arguments as long as you quote the task name
1706- $ task "echo-hello world"
1707- hello world
1708- # And you can pass multiple arguments
1709- $ task run-foo-bar
1710- foo bar
1711- ` ` `
1712-
1713- If multiple matching tasks are found, an error occurs. If you are using included
1714- Taskfiles, tasks in parent files will be considered first.
1712+ $ task "start:foo bar"
1713+ Starting foo bar
1714+ ` ` `
1715+
1716+ If multiple matching tasks are found, the first one listed in the Taskfile will
1717+ be used. If you are using included Taskfiles, tasks in parent files will be
1718+ considered first.
1719+
1720+ ` ` ` shell
1721+ $ task start:foo:3
1722+ Starting foo with 3 replicas
1723+ ` ` `
17151724
17161725# # Doing task cleanup with `defer`
17171726
0 commit comments