Skip to content

Commit 4da5758

Browse files
redsun82Copilot
andcommitted
Just: spell out that a multi-line separator is multiple shell lines
"Has to be a comment itself" reads as "has to start with `#`", and a value whose first line does while its later lines do not is not a comment -- every line after the first is its own shell line and runs. No mechanism for it. Flattening newlines would leave a single-line value that is not a comment still running while a multi-line one is defused: two spellings of the same mistake with opposite outcomes and no principle telling them apart. The obligation is on the value, so say what it is. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 420f249 commit 4da5758

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

misc/just/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ for itself, and the count is one per `mod` reached, however deeply nested, plus
162162
the file itself. That is cheap, and modules agree anyway since they share a terminal,
163163
but it is worth knowing before counting measurements. Presetting `JUST_CMD_RULE` skips
164164
all of them, and is also how to fix the width in CI or in a recording — it is the whole
165-
line, so set it to something the shell will treat as a comment.
165+
separator and ends up in a shell script, so every line of it has to be a comment.
166166

167167
With no terminal to ask — a pipe, a log, a shell without `stty` — it falls back to a
168168
fixed 57 columns, so logs and CI output are the same width every time. That is one

misc/just/defs.just

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ error := f'{{ style("error") }}error{{ NORMAL }}: '
2323
# With no terminal the value is non-numeric and this falls back to a fixed 57 columns.
2424
# That is a branch, not a platform test: just runs `sh` everywhere.
2525
#
26-
# `JUST_CMD_RULE` is the whole line and lands in a shell script, so a value set by hand
27-
# has to be a comment itself.
26+
# `JUST_CMD_RULE` is the whole separator and lands in a shell script, so a hand-set
27+
# value has to be a comment -- every line of it, if it has more than one. Nothing checks
28+
# that; a value that is not one gets run.
2829
#
2930
# Exported and preferred over measuring: `shell()` runs on every parse, so a forwarded
3031
# verb would otherwise re-measure in every child it spawns, and `if` is lazy in its

0 commit comments

Comments
 (0)