Skip to content

Commit

Permalink
Merge branch 'master' into unstable-env-var
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Oct 9, 2023
2 parents 180d661 + d17401e commit e68c07e
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 33 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ Starting server with database localhost:6379 on port 1337…
Variables, strings, concatenation, path joining, and substitution using `{{…}}` are supported:

```just
tmpdir := `mktemp`
tmpdir := `mktemp -d`
version := "0.2.7"
tardir := tmpdir / "awesomesauce-" + version
tarball := tardir + ".tar.gz"
Expand Down Expand Up @@ -1037,7 +1037,7 @@ $ just --evaluate
escapes := "\t\n\r\"\\"
```

Indented versions of both single- and double-quoted strings, delimited by triple single- or triple double-quotes, are supported. Indented string lines are stripped of leading whitespace common to all non-blank lines:
Indented versions of both single- and double-quoted strings, delimited by triple single- or triple double-quotes, are supported. Indented string lines are stripped of a leading line break, and leading whitespace common to all non-blank lines:

```just
# this string will evaluate to `foo\nbar\n`
Expand All @@ -1046,7 +1046,7 @@ x := '''
bar
'''
# this string will evaluate to `abc\n wuv\nbar\n`
# this string will evaluate to `abc\n wuv\nxyz\n`
y := """
abc
wuv
Expand Down Expand Up @@ -2014,7 +2014,7 @@ while:

### Command Line Options

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

```sh
$ just --list
Expand Down Expand Up @@ -2381,7 +2381,7 @@ foo argument:
touch '{{argument}}'
```

This preserves `just`'s ability to catch variable name typos before running, for example if you were to write `{{argument}}`, but will not do what you want if the value of `argument` contains single quotes.
This preserves `just`'s ability to catch variable name typos before running, for example if you were to write `{{arument}}`, but will not do what you want if the value of `argument` contains single quotes.

#### Positional Arguments

Expand Down
2 changes: 1 addition & 1 deletion README.中文.md
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ Starting server with database localhost:6379 on port 1337…
支持在变量、字符串、拼接、路径连接和替换中使用 `{{…}}`

```just
tmpdir := `mktemp`
tmpdir := `mktemp -d`
version := "0.2.7"
tardir := tmpdir / "awesomesauce-" + version
tarball := tardir + ".tar.gz"
Expand Down
12 changes: 6 additions & 6 deletions src/completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ pub(crate) const ZSH_COMPLETION_REPLACEMENTS: &[(&str, &str)] = &[
r#" local common=("#,
),
(
r#"'*--set=[Override <VARIABLE> with <VALUE>]' \"#,
r#"'*--set[Override <VARIABLE> with <VALUE>]: :_just_variables' \"#,
r"'*--set=[Override <VARIABLE> with <VALUE>]' \",
r"'*--set[Override <VARIABLE> with <VALUE>]: :_just_variables' \",
),
(
r#"'-s+[Show information about <RECIPE>]' \
'--show=[Show information about <RECIPE>]' \"#,
r#"'-s+[Show information about <RECIPE>]: :_just_commands' \
'--show=[Show information about <RECIPE>]: :_just_commands' \"#,
r"'-s+[Show information about <RECIPE>]' \
'--show=[Show information about <RECIPE>]' \",
r"'-s+[Show information about <RECIPE>]: :_just_commands' \
'--show=[Show information about <RECIPE>]: :_just_commands' \",
),
(
"'::ARGUMENTS -- Overrides and recipe(s) to run, defaulting to the first recipe in the \
Expand Down
6 changes: 3 additions & 3 deletions src/justfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -745,13 +745,13 @@ foo +a="Hello":

test! {
parse_raw_string_default,
r#"
r"
foo a='b\t':
"#,
r#"foo a='b\t':"#,
",
r"foo a='b\t':",
}

test! {
Expand Down
12 changes: 6 additions & 6 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1420,23 +1420,23 @@ mod tests {

test! {
name: indented_backtick,
text: r#"
text: r"
x := ```
\tfoo\t
\tbar\n
```
"#,
",
tree: (justfile (assignment x (backtick "\\tfoo\\t\n\\tbar\\n\n"))),
}

test! {
name: indented_backtick_no_dedent,
text: r#"
text: r"
x := ```
\tfoo\t
\tbar\n
```
"#,
",
tree: (justfile (assignment x (backtick "\\tfoo\\t\n \\tbar\\n\n"))),
}

Expand Down Expand Up @@ -1475,12 +1475,12 @@ mod tests {

test! {
name: parse_raw_string_default,
text: r#"
text: r"
foo a='b\t':
"#,
",
tree: (justfile (recipe foo (params (a "b\\t")))),
}

Expand Down
12 changes: 6 additions & 6 deletions tests/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,36 +1000,36 @@ a Z="\t z":

test! {
name: line_continuation_with_space,
justfile: r#"
justfile: r"
foo:
echo a\
b \
c
"#,
",
stdout: "ab c\n",
stderr: "echo ab c\n",
}

test! {
name: line_continuation_with_quoted_space,
justfile: r#"
justfile: r"
foo:
echo 'a\
b \
c'
"#,
",
stdout: "ab c\n",
stderr: "echo 'ab c'\n",
}

test! {
name: line_continuation_no_space,
justfile: r#"
justfile: r"
foo:
echo a\
b\
c
"#,
",
stdout: "abc\n",
stderr: "echo abc\n",
}
Expand Down
12 changes: 6 additions & 6 deletions tests/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,19 +318,19 @@ test! {

test! {
name: indented_raw_string_escapes,
justfile: r#"
justfile: r"
a := '''
foo\n
bar
'''
@default:
printf %s '{{a}}'
"#,
stdout: r#"
",
stdout: r"
foo\n
bar
"#,
",
}

test! {
Expand All @@ -353,7 +353,7 @@ test! {

test! {
name: indented_backtick_string_escapes,
justfile: r#"
justfile: r"
a := ```
printf %s '
foo\n
Expand All @@ -363,7 +363,7 @@ test! {
@default:
printf %s '{{a}}'
"#,
",
stdout: "\n\nfoo\\n\nbar",
}

Expand Down

0 comments on commit e68c07e

Please sign in to comment.