diff options
author | laniakea64 <laniakea64@users.noreply.github.com> | 2023-12-02 19:59:54 -0500 |
---|---|---|
committer | Casey Rodarmor <casey@rodarmor.com> | 2023-12-22 07:59:37 -0800 |
commit | 70e21d45db5d715314b9be2086f9cafb9e2116f3 (patch) | |
tree | 97540039c2bf07f673b4489c3902c70a41688642 | |
parent | ea7c157c6c7ea7f3c90336ff30bd3293c7c4f5cf (diff) |
Document line continuations (#1751)
-rw-r--r-- | README.md | 58 |
1 files changed, 58 insertions, 0 deletions
@@ -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: |