Skip to content

Commit

Permalink
Document line continuations (#1751)
Browse files Browse the repository at this point in the history
  • Loading branch information
laniakea64 authored and casey committed Dec 22, 2023
1 parent ea7c157 commit 70e21d4
Showing 1 changed file with 58 additions and 0 deletions.
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

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, although additional indentation is accepted.

```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

0 comments on commit 70e21d4

Please sign in to comment.