Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
zakuro9715 committed May 6, 2021
1 parent 69acadd commit c7fedd1
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,27 @@ hello world
```


### Args or flags
### Args

You can specify args and flags. They are passed to each commands
Args will be passed. You can use it as `$@`. If args.passthrough == true, args will be embedded in each commands

```
$ cat z.yaml
tasks:
hello: echo hello $@
hiho:
run:
- echo hi
- echo ho
args:
passthrough: true
$ z hello world
# It runs
sh -c "echo hello1 world"
sh -c "echo hello2 world"
sh -c "echo hello" "sh" "world"
$ z hiho world
# It runs
sh -c "echo hi world"
sh -c "echo ho world"
```

### Default task
Expand Down Expand Up @@ -300,16 +311,16 @@ tasks: # Task list
- z hello -- world # after -- is args (not subtask name)
args:
passthrough: true # passthrough arguments. So `z hello.world arg` will be `z hello -- world arg`
echo: echo # Shorthand command ('run' can be omitted').
echo: echo $@ # Shorthand command ('run' can be omitted').
echo.twice: # Multi commands can be used
- echo
- echo
- echo $@
- echo $@
echo.env.message: echo $MESSAGE # use env
echo.env.message2:
env: MESSAGE=message2 # task local default env
run: echo $MESSAGE
echo.var.value: echo {{value}} # use var
helloworld: z hello.world # Alias to other task
helloworld: z hello.world $@ # Alias to other task
```

```examples/npm.yaml
Expand Down

0 comments on commit c7fedd1

Please sign in to comment.