weir v0.0.40
Added
-
#helpis glanceable.#help <Module>lists one member per
line — the name plus the FIRST LINE of its doc (the same builtinDocs
source hover and#help Module.memberread, so the glance cannot
drift), clipped to the terminal. Bare#helpgives every module a
one-line blurb (Seq — lazy sequence pipeline ops: map, where, fold, pmap) from a new one-source table (moduleBlurbs), completeness
unit-pinned two ways against the derived module list — a new module
without a blurb fails loud. -
#find [query]— fuzzy help search. Every module (Seq — blurb)
and every member (Seq.map — glance) feeds fzf at a tty, with a
LIVE PREVIEW of the highlighted name's full doc; Enter prints the
exact#helpanswer for the selection, Esc returns quietly. The
preview runs the session's own binary headlessly — a new
weir --repl-doc <name>prints the exact#help <name>bytes
(builtin docs only, nothing evaluated; byte-equality e2e-pinned).
Without fzf, or piped,#find queryis a deterministic
case-insensitive substring filter over the same candidate lines —
never an "install fzf" message.--no-extendedleads the fzf argv
as in Ctrl+R (weir glyphs are fzf operators;finderFlagscan
restore--extended),#findTab-completes with the other session
directives, and a typo'd directive now gets a did-you-mean from the
same one-source list.docs/reference/lexical.mdgained the
consolidated directive table (script file / init.weir / prompt —
the three contexts), gated in e2e so a new directive cannot skip it. -
#alias name = cmd [args...]— command-head aliases, REPL-only.
A short head maps to a real program and a fixed prefix of arguments,
consulted ONLY in command-head position and BEFORE PATH. Declare them
ininit.weir(the canonical place), one per line:#alias k = kubectl #alias kb = kustomize buildNow
k get po -o yamlrunskubectl get po -o yamlandkb overlays/prodrunskustomize build overlays/prod— the fixed
prefix is inserted after the exe, your argv appended. It is a
RESOLUTION-table entry, not a textual macro: your argv stays typed
argv, sok get $xpasses$xas ONE argument (the injection law
holds), and only the HEAD token in command-head position is rewritten
— akin a string, a variable, or an argument is untouched. The
resolution order is alias table → PATH, and the^force-PATH
sigil skips the table, so a shadowing alias (#alias ls = ls --color) is bypassable with^ls. Aliases are single-hop (the
target is a program, never another alias — an alias-of-alias is
rejected at load) and REPL-only: scripts and-enever load
init.weir, so their command resolution is unchanged and an alias
name there is an ordinary unknown command. The target need not exist
when defined (like bash); a malformed#aliasline is a loud init
error (init stays all-or-nothing). A live#aliasworks at the
prompt too (bare#aliaslists the table), butinit.weiris the
canonical home. -
#savedesugars aliases. The saved script has no alias table, so
each kept line's command HEAD is span-rewritten back to the real
invocation —let pods = k get posaves aslet pods = kubectl get po, a keptkb overlays/prodaskustomize build overlays/prod.
The rewrite is head-only (akin a string is untouched), and the
output is alias-free andweir checkclean.
Changed
- The unknown-directive message dropped its
#sig/#schema
parenthetical. It was noise for an unrelated typo (a bare#or
#timedoes not care about file directives). Now#sig/#schema
at the REPL get their own "file directive, read at check time — no
effect in the REPL" redirect (mirroring#session's), and the
generic catch-all is justunknown directive '…' — #help lists them.