Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document just 1.15.0 line continuation syntax #1751

Merged
merged 3 commits into from
Dec 3, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2076,6 +2076,64 @@ while:
done
```

#### Outside recipe bodies
casey marked this conversation as resolved.
Show resolved Hide resolved

Parenthesized expressions can span multiple lines:

```just
abc := ('a' +
'b'
+ 'c')

abc2 := (
'a' +
'b' +
'c'
)

foo param=('foo'
+ 'bar'
):
echo {{param}}

bar: (foo
'Foo'
)
echo 'Bar!'
```

Lines ending with a backslash continue on to the next line as if the lines were joined by whitespace<sup>1.15.0</sup>:

```just
a := 'foo' + \
'bar'

foo param1 \
param2='foo' \
*varparam='': dep1 \
(dep2 'foo')
echo {{param1}} {{param2}} {{varparam}}

dep1: \
# this comment is not part of the recipe body
echo 'dep1'

dep2 \
param:
echo 'Dependency with parameter {{param}}'
```

Backslash line continuations can also be used in interpolations. The line following the backslash must start with the same indentation as the recipe body, though additional indentation can be appended.

```just
recipe:
echo '{{ \
"This interpolation " + \
"has a lot of text." \
}}'
echo 'back to recipe body'
```

### Command Line Options

`just` supports a number of useful command line options for listing, dumping, and debugging recipes and variables:
Expand Down
Loading