Document settings in readme (#527)

This commit is contained in:
Casey Rodarmor 2019-11-12 13:34:00 -08:00 committed by GitHub
parent d52b8f22a3
commit 9f82ed9015
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -233,6 +233,45 @@ echo 'Building!'
Building! Building!
``` ```
=== Settings
Settings control interpetation and execution. Each setting may be specified at most once, anywhere in the justfile.
For example:
```make
set shell := ["zsh", "-cu"]
foo:
# this line will be run as `zsh -cu 'ls **/*.txt'`
ls **/*.txt
```
==== Table of Settings
[options="header"]
|=================
| Name | Value | Description
|`shell` | `[COMMAND, ARGS...]` | Set the command used to invoke recipes and evaluate backticks.
|=================
==== Shell
The `shell` setting controls the command used to invoke recipe lines and backticks. Shebang recipes are unaffected.
```make
# use python3 to execute recipe lines and backticks
set shell := ["python3", "-c"]
# use print to capture result of evaluation
foos := `print("foo" * 4)`
foo:
print("Snake snake snake snake.")
print("{{foos}}")
```
=== Documentation Comments === Documentation Comments
Comments immediately preceding a recipe will appear in `just --list`: Comments immediately preceding a recipe will appear in `just --list`: