Skip to content

Commit ee6fcd4

Browse files
redsun82Copilot
andcommitted
Just: name the separator variables after what they hold
`_rule` reads as a policy in a file that has several, and the value is a line of `#`. `JUST_CMD_RULE` keeps its name, being the documented way to preset one. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 5f59009 commit ee6fcd4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

misc/just/defs.just

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ error := f'{{ style("error") }}error{{ NORMAL }}: '
3838
# verb would otherwise re-measure in every child it spawns, and `if` is lazy in its
3939
# branches. Inheritance needs a process, so a `mod` measures for itself; presetting
4040
# `JUST_CMD_RULE` skips measuring entirely.
41-
_given_rule := env('JUST_CMD_RULE', '')
41+
_given_horizontal_rule := env('JUST_CMD_RULE', '')
4242

43-
_rule := if _given_rule == '' { shell('''
43+
_horizontal_rule := if _given_horizontal_rule == '' { shell('''
4444
w=$(stty size 2>/dev/null | cut -d" " -f2)
4545
case "$w" in '' | *[!0-9]*) w=57 ;; esac
4646
printf "%*s" $w "" | tr " " '#'
47-
''') } else { _given_rule }
47+
''') } else { _given_horizontal_rule }
4848

49-
export JUST_CMD_RULE := _rule
49+
export JUST_CMD_RULE := _horizontal_rule
5050

51-
cmd_sep := "\n" + _rule + "\n"
51+
cmd_sep := "\n" + _horizontal_rule + "\n"
5252
export CMD_BEGIN := style("command") + cmd_sep
5353
export CMD_END := cmd_sep + NORMAL
5454
export JUST_ERROR := error

0 commit comments

Comments
 (0)