Browse Source

make.tcl argdoc restyle: braced -& definitions with tstr placeholders; centred Descriptions

Convert every ::punkboot::argdoc punk::args::define to the braced file-style
block form established for the shell/tool definitions in 7ec7da4a: -& record
continuations, -summary/-help pulled from SUMMARIES/HELPTEXTS via tstr
placeholders, shared OPT_* option fragments interpolated as ${$OPT_...}
records. The SUBOPTS/OPT_SYNOPSES/VALUES_SYNOPSES/SUBVALUES tables and the
define loop are unrolled into 16 per-subcommand blocks; buildsuite/help and
the top-level definition follow the same idiom (help gains a HELPTEXTS entry;
the top-level body moves to argdoc's TOPLEVEL_HELP variable). @normalize is
dropped: -help bodies are display fields (punk::args G-046 deferred
expansion), so the HELPTEXTS block indentation now reaches the rendered
Description verbatim - every 'make.tcl help <subcommand>' Description renders
centred like 'make.tcl help tool' instead of left-aligned.

No parsing or interface changes: option/values specs, synopses, exit codes,
prefix resolution, unknown-flag/subcommand errors, PUNKBOOT_PLAIN degraded
mode and the capability probes all verified unchanged (before/after usage
captures diffed for all 20 help subjects; shell/tool byte-identical). Narrow
usage tables widen slightly to fit the indented Description.
KITNAME_CHOICEPART persists as a namespace variable because the kitname
records interpolate it at (lazy) definition resolve time.

Docs: src/AGENTS.md make.tcl bullets updated (braced-def contract, per-block
maintenance rule); src/modules/AGENTS.md G-045 subsection re-points the
@normalize exemplar to punk.tm only and records argdoc as the braced -& +
tstr exemplar. punkshell 0.39.3 + CHANGELOG entry. Thin-layout make.tcl
copies resynced via 'make.tcl libs -confirm 0' (basic, project-0.1, modpod
templates copy - byte-identical).

Assisted-by: harness=claude; primary-model=claude-fable-5; api-location=anthropic.com
master
Julian Noble 1 week ago
parent
commit
320add60ad
  1. 12
      CHANGELOG.md
  2. 2
      punkproject.toml
  3. 4
      src/AGENTS.md
  4. 409
      src/make.tcl
  5. 4
      src/modules/AGENTS.md
  6. 409
      src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/project_layouts/vendor/punk/project-0.1/src/make.tcl
  7. 409
      src/project_layouts/vendor/punk/basic/src/make.tcl
  8. 409
      src/project_layouts/vendor/punk/project-0.1/src/make.tcl

12
CHANGELOG.md

@ -5,6 +5,18 @@ The latest `## [X.Y.Z]` header must match the `version` field in `punkproject.to
Entries are newest-first; one bullet per notable change. See the root `AGENTS.md`
"Project Versioning" section for the bump policy.
## [0.39.3] - 2026-08-01
- make.tcl help restyle: every punk::args definition in `::punkboot::argdoc` is
now a braced file-style block with `-&` record continuations and tstr
placeholders (the punk module doc-block idiom; the SUBOPTS/OPT_SYNOPSES/
VALUES_SYNOPSES/SUBVALUES define loop is unrolled into per-subcommand blocks).
Help bodies are display fields expanded deferred, so each subcommand's
Description now renders block-form with its HELPTEXTS indentation - the
centred look of `make.tcl help tool` - instead of left-aligned (`@normalize`
re-basing dropped). No parsing or interface changes; narrow usage tables
widen slightly to fit the indented Description.
## [0.39.2] - 2026-08-01
- make.tcl tool build: installed exe mtime is now stamped with the install time.

2
punkproject.toml

@ -1,6 +1,6 @@
[project]
name = "punkshell"
version = "0.39.2"
version = "0.39.3"
license = "BSD-2-Clause"
url = "https://www.gitea1.intx.com.au/jn/punkshell"
#packager: declared identity for published artifacts (declarative, not proof -

4
src/AGENTS.md

@ -68,8 +68,8 @@ Recovery after a wrong path guess:
- All build/promotion commands (`bakehouse`, `packages`, `modules`, `libs`, `bake`, `vfslibs`, `bin`, `bootsupport`, `vfscommonupdate`) warn similarly when this project's own `src/` has uncommitted fossil/git changes (dirt outside `src/` is ignored). Warn-only by default EXCEPT `bakehouse` (aborts by default; `-dirty-abort 0` overrides); pass `-dirty-abort` elsewhere to make the check aborting. For evaluating uncommitted source without a build, prefer `<builtexe> src` / `<builtexe> src shell`. The check is `punkboot::utils::vcs_dirty_warnings` (optional scope argument) loaded guardedly from bootsupport - if the snapshot is stale/missing the check degrades to a skip notice (but `-dirty-abort` then aborts rather than silently losing the requested strictness).
- Provenance warnings (dirty-src gate + vendorupdate source-project check) print with a plain column-0 `PROVENANCE-WARNING:` token (grep for it in captured build output) and are recapped at the end of the run via make.tcl's wrapped `::exit`. Interactive terminal runs get a 3-second ctrl-c grace countdown before a dirty build proceeds; piped/agent runs skip it. `tclsh src/make.tcl check` reports the current src provenance status and what the build commands would do.
- Use `tclsh src/make.tcl vfscommonupdate` to rebuild `_vfscommon.vfs`. The REPLACE confirmation prompts on an interactive terminal; unattended/agent runs must pass `-confirm 0` (with the default `-confirm 1` and a piped/closed stdin, make.tcl aborts fast with guidance instead of reading stdin - do not pipe `y`).
- `tclsh src/make.tcl workflow` prints an embedded ASCII data-flow overview of the build/release workflow (release-ready command sequence, source→outputs folder flow, kit assembly, keyed notes). The text lives in `::punkboot::workflow_text` in `src/make.tcl` - embedded rather than a data file so it travels with the make.tcl copies seeded into generated projects. **Update contract (agents):** whenever build data flow changes - a make.tcl subcommand added/removed/repurposed, a source or output folder added or rerouted, a propagation target added, a gate (staleness/provenance/confirm) or deploy behaviour changed - update the workflow text in the same change-set. Keep it plain ASCII, max line width 100, and preserve the RELEASE SEQUENCE / DIAGRAM / KEY-NOTES / MAINTENANCE structure; verify by running `tclsh src/make.tcl workflow` (and once under `PUNKBOOT_PLAIN=1`). Adding/changing a subcommand also means: SUMMARIES + HELPTEXTS + SUBOPTS (+ SUBGROUPS) in `::punkboot::argdoc`, `known_commands`, the plain `punkboot_gethelp` text, and a project-version bump (make.tcl interface is product surface per root AGENTS.md). Layout make.tcl copies pick the change up via the thin-layout sync step in any `make.tcl modules`/`libs`/`packages`/`bakehouse` run - do not hand-sync them.
- make.tcl subcommands and flags are punk::args-declared (G-030): `tclsh src/make.tcl help ?subcommand?` or `<subcommand> -help` shows tabled usage; invalid arguments produce punk::args usage errors. The dispatch degrades to plain scan/help when the bootsupport punk::args (or its rendering stack) is stale or unavailable; `PUNKBOOT_PLAIN=1` forces the degraded mode for troubleshooting. The `::punkboot::argdoc` definitions are constructed (string-built) and use the G-045 authoring mechanisms — block-form help values + `@normalize`, explicit `@form -synopsis` — see src/modules/AGENTS.md "punk::args definition authoring ergonomics" before editing them or authoring similar definitions.
- `tclsh src/make.tcl workflow` prints an embedded ASCII data-flow overview of the build/release workflow (release-ready command sequence, source→outputs folder flow, kit assembly, keyed notes). The text lives in `::punkboot::workflow_text` in `src/make.tcl` - embedded rather than a data file so it travels with the make.tcl copies seeded into generated projects. **Update contract (agents):** whenever build data flow changes - a make.tcl subcommand added/removed/repurposed, a source or output folder added or rerouted, a propagation target added, a gate (staleness/provenance/confirm) or deploy behaviour changed - update the workflow text in the same change-set. Keep it plain ASCII, max line width 100, and preserve the RELEASE SEQUENCE / DIAGRAM / KEY-NOTES / MAINTENANCE structure; verify by running `tclsh src/make.tcl workflow` (and once under `PUNKBOOT_PLAIN=1`). Adding/changing a subcommand also means: SUMMARIES + HELPTEXTS + its braced `punk::args::define` block (+ SUBGROUPS) in `::punkboot::argdoc`, `known_commands`, the plain `punkboot_gethelp` text, and a project-version bump (make.tcl interface is product surface per root AGENTS.md). Layout make.tcl copies pick the change up via the thin-layout sync step in any `make.tcl modules`/`libs`/`packages`/`bakehouse` run - do not hand-sync them.
- make.tcl subcommands and flags are punk::args-declared (G-030): `tclsh src/make.tcl help ?subcommand?` or `<subcommand> -help` shows tabled usage; invalid arguments produce punk::args usage errors. The dispatch degrades to plain scan/help when the bootsupport punk::args (or its rendering stack) is stale or unavailable; `PUNKBOOT_PLAIN=1` forces the degraded mode for troubleshooting. The `::punkboot::argdoc` definitions are braced file-style blocks using the G-045 authoring mechanisms — `-&` record continuations, tstr placeholders pulling SUMMARIES/HELPTEXTS and the shared `OPT_*` option fragments, explicit `@form -synopsis` with `-help` bodies expanding as deferred display fields so the HELPTEXTS block indentation deliberately renders as a centred Description (no `@normalize` re-basing); see src/modules/AGENTS.md "punk::args definition authoring ergonomics" before editing them or authoring similar definitions.
- Uncommitted `make.tcl`-generated outputs may be batched into one commit, regardless of how many `make.tcl` invocations produced them. This covers punkcheck-managed build outputs that are VCS-tracked: `src/bootsupport/`, `_vfscommon.vfs/modules` + `/lib`, declared per-kit `*.vfs/lib_tcl<N>/<pkg>` subfolders, the thin-layout sync copies (`src/project_layouts/vendor/punk/<layout>/src/{make.tcl,build.tcl}` + bootsupport manifest copies), and the module-shipped layout payload under `src/modules/punk/mix/#modpod-templates-*/templates/project_layouts/` (G-087: synced from `src/project_layouts` - never hand-edit the modpod copy). (Root `modules/`, `lib/`, `modules_tcl<N>/`, `lib_tcl<N>/` are gitignored and never committed.) Each module's old→new version rename is atomic; a regeneration reflects one build-output refresh, not independent hand-edits. This is a carve-out from generic "split aggressively" commit guidance for punkcheck-managed build outputs only — it does not cover user-curated VFS content (`_config/`, per-kit `*.vfs/` outside declared `lib_tcl<N>` subfolders, `_aside/`, `mkzipfix.vfs`, `_vfscommon.vfs/doc`), which commits separately per its own concerns.
- **Boot-precondition gate (G-125).** A bake refuses any kit whose merged `.vfs` supplies no tcl library: the kit is listed under `FAILED KITS` with a reason naming the cause, and NOTHING is written - no `src/_build/<kit>`, no deploy, and the previously deployed `bin/<kit>` is left byte-identical. This is deliberately a failure rather than a warning: the deploy step deletes the old kit before copying the new one, so the pre-gate behaviour replaced a working shell with an artifact that died at startup with `application-specific initialization failed: Cannot find a usable init.tcl`. The check is structural and non-executing (so it covers cross-target kits too): `init.tcl` in `tcl_library/`, `lib/tcl<major>.<minor>/` or `tcl<major>.<minor>/` - the third for runtimes whose archive mounts at the executable's own path rather than `//zipfs:/app`, so `[info library]` is `<exe>/tcl8.6` (the androwish/undroidwish zipfs backport for 8.6 does this) - plus one companion file a real Tcl library carries beside it (`tm.tcl`, `package.tcl`, `auto.tcl`, `clock.tcl`, `history.tcl`, `word.tcl`) or an `encoding/` directory - without that second test the `lib/BWidget1.10.1/init.tcl` every punkshell kit carries would answer for a tcl library it cannot provide. It reads the MERGED tree rather than asking whether extraction ran, so a `.vfs` that legitimately supplies its own tcl library (`src/vfs/punk8_statictwapi.vfs`, `src/vfs/punk9test.vfs`) builds and deploys unchanged. **Remedy when a kit is refused:** the usual cause is that the runtime's own payload could not be extracted - read the recapped `BUILD-WARNING` naming what was tried, then either fix extraction (a driving tclsh with no zipfs needs punk::zip >= 0.2.0 in bootsupport - see the extraction bullet above), point the kit at a runtime that carries a payload, or have the kit's `.vfs` supply a tcl library itself. The predicate is `punkboot::utils::vfs_boot_library_report` called through a guarded require, exactly as the dirty-src provenance check is: a stale or missing bootsupport snapshot degrades the gate to a `NOTE` rather than failing every kit. `tclsh src/make.tcl check` reports whether the gate is `ACTIVE` or `UNAVAILABLE`.
- **Payload/target consistency checks (G-133), both ADVISORY** - warnings are recapped `BUILD-WARNING`s and the kit still builds and deploys (unlike the G-125 gate). (a) **Binary-arch scan**, at the same post-merge seam as the gate: every binary library (`*.dll`/`*.so`/`*.dylib`) in the merged tree is classified by header bytes (`punkboot::utils::binary_arch_classify` - PE Machine field, ELF e_machine, Mach-O incl. universal; unclassifiable content is honestly `unknown` and never warned about) against the kit's target platform. Structural and non-executing, so it runs for cross-target kits too (measured ~30-140ms per kit, avg ~93ms across the 12 assembled trees). Libraries under a platform-discriminated subdir - canonical `<os>-<cpu>` platform-dir names, the universal `macosx` folder, or a recognised vendor spelling (`win-x64` etc; the lists are namespace variables in `punkboot::utils`) - are exempt: multi-arch payloads are legitimate there. First real sweep (2026-07-27) found a true latent instance: `zint.dll` 2.13.0 in `src/vfs/punk8win.vfs/lib_tcl8/` is 32-bit (i386) and can never load in the x64 tcl8 kits (punk86/punkbi/punksys) that carry it - those bakes warn until the payload is fixed. (b) **Smoke-require probe**: a kit declaring packages in `src/runtime/mapvfs.toml` (`smokerequire` key - see `src/runtime/AGENTS.md`) has each one plain-`package require`d INSIDE the freshly built artifact via its tclsh subcommand, which exits cleanly even on runtimes whose full repl teardown is fragile. This is the only check that observes actual package RESOLUTION - the punkluck86 2026-07-27 incident class (a higher-versioned wrong-arch Thread shadowing the runtime's working copy on plain require) is invisible to structural checks because the working file exists too. Failures are recapped naming kit, package and the actual error; cross-target kits skip with a stated reason; undeclared kits run nothing new; the probe only runs when the kit actually rebuilds. **What the checks do NOT guarantee:** statically linked packages, pure-tcl packages whose binary dependency lives elsewhere, and version-preference outcomes are visible only to the smoke probe - and only for the declared package set; the arch scan proves nothing about loadability beyond architecture, and an `unknown` classification is silence, not a pass. Both degrade to a NOTE when the bootsupport `punkboot::utils` snapshot is stale (same guarded require as the G-125 gate); `tclsh src/make.tcl check` reports the scan's ACTIVE/UNAVAILABLE state and the currently declared smoke-require kits.

409
src/make.tcl

@ -3033,12 +3033,13 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
buildsuite "List, describe or run the defined buildsuites under src/buildsuites (zig runtime factory)"
tool "List, test or build the vendored tools under src/tools (zig) and install them to <projectdir>/bin"
}
#@cmd -help bodies for the constructed definitions below. Authored BLOCK-FORM
#(first value line whitespace-only) so the @normalize directive in each
#definition re-bases the embedded source indentation - the G-045 mechanism for
#string-built definitions, which get no automatic whole-block indent
#normalization (head-form values here would leak this file's indentation into
#the rendered Description column).
#@cmd -help bodies for the braced definitions below, pulled in via tstr
#placeholders ({${[dict get $HELPTEXTS <sub>]}}). -help is a display field,
#expanded DEFERRED (punk::args G-046) - each body lands in the rendered
#Description column verbatim, so the BLOCK-FORM authoring here (first value
#line whitespace-only, content uniformly indented) deliberately carries this
#indentation into the display: the centred Description look of the punk
#module doc blocks (no @normalize re-basing).
variable HELPTEXTS {
bakehouse
"
@ -3215,6 +3216,10 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
The text is embedded in make.tcl (::punkboot::workflow_text) so it is
available wherever make.tcl runs; its MAINTENANCE key states the
update contract for keeping it in step with build behaviour."
help
"
Show tabled usage for make.tcl as a whole, or for a single subcommand.
Equivalent to 'make.tcl <subcommand> -help'."
buildsuite
"
Surface for the defined buildsuites under src/buildsuites (zig-built
@ -3280,7 +3285,9 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
deliberately left in place between runs for rebuild speed (both
git- and fossil-ignored)."
}
#shared option fragments composed into the per-subcommand definitions below
#shared option fragments interpolated into the per-subcommand definitions
#below via tstr placeholders (${$OPT_...}) - expanded eagerly at resolve time
#in this namespace, so each definition receives these records verbatim
variable OPT_CONFIRM {
-confirm -type boolean -default 1 -help\
"Interactive y/n confirmation policy.
@ -3347,45 +3354,14 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
"Re-download and re-materialize even when a present artifact
already verifies against the server sha1sums."
}
#which shared option fragments each subcommand declares
#(shell and help have bespoke definitions below: shell passes trailing args
# through to the repl untouched, help takes a subject value)
variable SUBOPTS {
bakehouse {OPT_FORCEKILL OPT_DIRTYABORT_ON OPT_CONFIRM}
packages {OPT_DIRTYABORT OPT_CONFIRM}
modules {OPT_DIRTYABORT OPT_CONFIRM}
libs {OPT_DIRTYABORT OPT_CONFIRM}
bake {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM}
bakelist {}
vfslibs {OPT_DIRTYABORT OPT_CONFIRM}
bin {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM}
vendorupdate {OPT_CONFIRM}
libfetch {OPT_SERVERURL OPT_TRUSTSERVER OPT_FORCE}
bootsupport {OPT_DIRTYABORT OPT_CONFIRM}
vfscommonupdate {OPT_DIRTYABORT OPT_CONFIRM}
info {OPT_CONFIRM}
check {}
projectversion {}
workflow {}
}
#synopsis fragments matching the shared option fragments (explicit @form -synopsis
#so usage shows the real invocation 'make.tcl <subcommand> ...' rather than the
#internal definition id)
variable OPT_SYNOPSES {
OPT_FORCEKILL "?-k?"
OPT_DIRTYABORT "?-dirty-abort?"
OPT_DIRTYABORT_ON "?-dirty-abort 1|0?"
OPT_CONFIRM "?-confirm 0|1?"
OPT_SERVERURL "?-serverurl <url>?"
OPT_TRUSTSERVER "?-trust-server?"
OPT_FORCE "?-force?"
}
#per-subcommand positional values (default: none). bake and bakelist take
#optional kit names (G-121 selective bake).
#bake and bakelist take optional trailing kit names (G-121 selective bake).
#Discoverability nicety: the configured kit names are offered as choices when
#the mapping parses at definition time - informational only (-choicerestricted
#0), so the handlers' own validation (which lists the configured names, and
#still works when the mapping cannot be parsed here) stays authoritative.
#KITNAME_CHOICEPART persists as a namespace variable because the kitname
#records below interpolate it at definition RESOLVE time (lazy - first
#parse/usage/get_spec of the bake/bakelist ids).
variable KITNAME_CHOICES [list]
catch {
set _mapmodel [punkboot::lib::mapvfs_parse [punkboot::lib::mapvfs_locate [file join $::punkboot::scriptfolder runtime]] "" $::punkboot::scriptfolder $::punkboot::target_platform]
@ -3397,60 +3373,211 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
lappend KITNAME_CHOICES @$_g
}
}
set _kitname_choicepart ""
variable KITNAME_CHOICEPART ""
if {[llength $KITNAME_CHOICES]} {
set _kitname_choicepart " -choices [list $KITNAME_CHOICES] -choicerestricted 0"
}
variable SUBVALUES [dict create]
dict set SUBVALUES bake [list\
"@values -min 0 -max -1"\
"kitname -type string -optional 1 -multiple 1${_kitname_choicepart} -help\
{
Configured kit output(s) to bake and deploy - a kit name, or
@<groupname> for every kit in a configured group (G-024) - see
'make.tcl bakelist' for the configured names and groups. With no
kitname, all configured kits are processed except entries with
bake_default=false. An unknown name errors before any build.}"\
]
dict set SUBVALUES bakelist [list\
"@values -min 0 -max -1"\
"kitname -type string -optional 1 -multiple 1${_kitname_choicepart}\
-help\
{
Configured kit output(s) to report on - a kit name, or @<groupname>
for every kit in a configured group (filters the listing - doubles
as per-kit detail). With no kitname, all configured entries are
listed.}"\
]
variable VALUES_SYNOPSES {
bake "?kitname ...?"
bakelist "?kitname ...?"
}
foreach {sub optvars} $SUBOPTS {
set synparts [list "make.tcl $sub"]
foreach ov $optvars {
lappend synparts [dict get $OPT_SYNOPSES $ov]
}
if {[dict exists $VALUES_SYNOPSES $sub]} {
lappend synparts [dict get $VALUES_SYNOPSES $sub]
}
set defparts [list]
lappend defparts "@id -id (script)::punkboot::$sub"
lappend defparts "@normalize" ;#G-045 block-form value re-basing for constructed definitions
lappend defparts "@cmd -name [list "make.tcl $sub"] -summary [list [dict get $SUMMARIES $sub]] -help [list [dict get $HELPTEXTS $sub]]"
lappend defparts "@form -synopsis [list [join $synparts { }]]"
lappend defparts "@opts"
foreach ov $optvars {
lappend defparts [set $ov]
}
if {[dict exists $SUBVALUES $sub]} {
foreach vp [dict get $SUBVALUES $sub] {
lappend defparts $vp
}
} else {
lappend defparts "@values -min 0 -max 0"
}
punk::args::define {*}$defparts
set KITNAME_CHOICEPART " -choices [list $KITNAME_CHOICES] -choicerestricted 0"
}
#per-subcommand definitions: braced file-style blocks with -& record
#continuations (G-045). -summary values and -help bodies are pulled from
#SUMMARIES/HELPTEXTS via tstr placeholders; the shared option fragments
#(${$OPT_...}) and the kitname choice part expand eagerly at (lazy) resolve
#time in this namespace, while the -help bodies are display fields (G-046
#deferred expansion - their block indentation reaches the render verbatim).
punk::args::define {
@id -id "(script)::punkboot::bakehouse"
@cmd -name "make.tcl bakehouse" -&
-summary "${[dict get $SUMMARIES bakehouse]}" -&
-help -&
{${[dict get $HELPTEXTS bakehouse]}}
@form -synopsis "make.tcl bakehouse ?-k? ?-dirty-abort 1|0? ?-confirm 0|1?"
@opts
${$OPT_FORCEKILL}
${$OPT_DIRTYABORT_ON}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::packages"
@cmd -name "make.tcl packages" -&
-summary "${[dict get $SUMMARIES packages]}" -&
-help -&
{${[dict get $HELPTEXTS packages]}}
@form -synopsis "make.tcl packages ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::modules"
@cmd -name "make.tcl modules" -&
-summary "${[dict get $SUMMARIES modules]}" -&
-help -&
{${[dict get $HELPTEXTS modules]}}
@form -synopsis "make.tcl modules ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::libs"
@cmd -name "make.tcl libs" -&
-summary "${[dict get $SUMMARIES libs]}" -&
-help -&
{${[dict get $HELPTEXTS libs]}}
@form -synopsis "make.tcl libs ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::bake"
@cmd -name "make.tcl bake" -&
-summary "${[dict get $SUMMARIES bake]}" -&
-help -&
{${[dict get $HELPTEXTS bake]}}
@form -synopsis "make.tcl bake ?-k? ?-dirty-abort? ?-confirm 0|1? ?kitname ...?"
@opts
${$OPT_FORCEKILL}
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max -1
kitname -type string -optional 1 -multiple 1${$KITNAME_CHOICEPART} -help -&
"Configured kit output(s) to bake and deploy - a kit name, or
@<groupname> for every kit in a configured group (G-024) - see
'make.tcl bakelist' for the configured names and groups. With no
kitname, all configured kits are processed except entries with
bake_default=false. An unknown name errors before any build."
}
punk::args::define {
@id -id "(script)::punkboot::bakelist"
@cmd -name "make.tcl bakelist" -&
-summary "${[dict get $SUMMARIES bakelist]}" -&
-help -&
{${[dict get $HELPTEXTS bakelist]}}
@form -synopsis "make.tcl bakelist ?kitname ...?"
@values -min 0 -max -1
kitname -type string -optional 1 -multiple 1${$KITNAME_CHOICEPART} -help -&
"Configured kit output(s) to report on - a kit name, or @<groupname>
for every kit in a configured group (filters the listing - doubles
as per-kit detail). With no kitname, all configured entries are
listed."
}
punk::args::define {
@id -id "(script)::punkboot::vfslibs"
@cmd -name "make.tcl vfslibs" -&
-summary "${[dict get $SUMMARIES vfslibs]}" -&
-help -&
{${[dict get $HELPTEXTS vfslibs]}}
@form -synopsis "make.tcl vfslibs ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::bin"
@cmd -name "make.tcl bin" -&
-summary "${[dict get $SUMMARIES bin]}" -&
-help -&
{${[dict get $HELPTEXTS bin]}}
@form -synopsis "make.tcl bin ?-k? ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_FORCEKILL}
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::vendorupdate"
@cmd -name "make.tcl vendorupdate" -&
-summary "${[dict get $SUMMARIES vendorupdate]}" -&
-help -&
{${[dict get $HELPTEXTS vendorupdate]}}
@form -synopsis "make.tcl vendorupdate ?-confirm 0|1?"
@opts
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::libfetch"
@cmd -name "make.tcl libfetch" -&
-summary "${[dict get $SUMMARIES libfetch]}" -&
-help -&
{${[dict get $HELPTEXTS libfetch]}}
@form -synopsis "make.tcl libfetch ?-serverurl <url>? ?-trust-server? ?-force?"
@opts
${$OPT_SERVERURL}
${$OPT_TRUSTSERVER}
${$OPT_FORCE}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::bootsupport"
@cmd -name "make.tcl bootsupport" -&
-summary "${[dict get $SUMMARIES bootsupport]}" -&
-help -&
{${[dict get $HELPTEXTS bootsupport]}}
@form -synopsis "make.tcl bootsupport ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::vfscommonupdate"
@cmd -name "make.tcl vfscommonupdate" -&
-summary "${[dict get $SUMMARIES vfscommonupdate]}" -&
-help -&
{${[dict get $HELPTEXTS vfscommonupdate]}}
@form -synopsis "make.tcl vfscommonupdate ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::info"
@cmd -name "make.tcl info" -&
-summary "${[dict get $SUMMARIES info]}" -&
-help -&
{${[dict get $HELPTEXTS info]}}
@form -synopsis "make.tcl info ?-confirm 0|1?"
@opts
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::check"
@cmd -name "make.tcl check" -&
-summary "${[dict get $SUMMARIES check]}" -&
-help -&
{${[dict get $HELPTEXTS check]}}
@form -synopsis "make.tcl check"
@opts
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::projectversion"
@cmd -name "make.tcl projectversion" -&
-summary "${[dict get $SUMMARIES projectversion]}" -&
-help -&
{${[dict get $HELPTEXTS projectversion]}}
@form -synopsis "make.tcl projectversion"
@opts
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::workflow"
@cmd -name "make.tcl workflow" -&
-summary "${[dict get $SUMMARIES workflow]}" -&
-help -&
{${[dict get $HELPTEXTS workflow]}}
@form -synopsis "make.tcl workflow"
@opts
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::shell"
@ -3465,15 +3592,18 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
arg -type any -optional 1 -multiple 1 -help -&
"Arguments passed through to the punk repl."
}
punk::args::define\
"@id -id (script)::punkboot::buildsuite"\
"@normalize"\
"@cmd -name [list "make.tcl buildsuite"] -summary [list [dict get $SUMMARIES buildsuite]] -help [list [dict get $HELPTEXTS buildsuite]]"\
{@form -synopsis "make.tcl buildsuite list|info|build ?<suitename>? ?driver-args ...?"}\
{@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help\
punk::args::define {
@id -id "(script)::punkboot::buildsuite"
@cmd -name "make.tcl buildsuite" -&
-summary "${[dict get $SUMMARIES buildsuite]}" -&
-help -&
{${[dict get $HELPTEXTS buildsuite]}}
@form -synopsis "make.tcl buildsuite list|info|build ?<suitename>? ?driver-args ...?"
@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help -&
"Action (list|info|build), suite name, and - for build - driver
arguments forwarded to the suite's suite.tcl untouched."}
arguments forwarded to the suite's suite.tcl untouched."
}
punk::args::define {
@id -id "(script)::punkboot::tool"
@ -3488,16 +3618,18 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
the -test 0|1 gate flag. Parsed by the handler."
}
punk::args::define\
"@id -id (script)::punkboot::help"\
"@normalize"\
"@cmd -name [list "make.tcl help"] -summary [list [dict get $SUMMARIES help]] -help [list\
"
Show tabled usage for make.tcl as a whole, or for a single subcommand.
Equivalent to 'make.tcl <subcommand> -help'."]"\
{@form -synopsis "make.tcl help ?subcommand?"}\
"@values -min 1 -max 1"\
"subject -type string -optional 0 -choices [list [dict keys $SUMMARIES]] -help {Subcommand to show usage for.}"
punk::args::define {
@id -id "(script)::punkboot::help"
@cmd -name "make.tcl help" -&
-summary "${[dict get $SUMMARIES help]}" -&
-help -&
{${[dict get $HELPTEXTS help]}}
@form -synopsis "make.tcl help ?subcommand?"
@values -min 1 -max 1
subject -type string -optional 0 -&
-choices {${[dict keys $SUMMARIES]}} -&
-help "Subcommand to show usage for."
}
#top-level definition: the subcommand table rendered by 'make.tcl' / 'make.tcl -help'
variable SUBGROUPS {
"build & bake" {bakehouse packages modules libs bake vfslibs bin}
@ -3508,34 +3640,43 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
"informational" {info check bakelist projectversion workflow help}
"interactive" {shell}
}
punk::args::define\
"@id -id (script)::punkboot"\
"@normalize"\
"@cmd -name make.tcl -summary {punkshell project build tool (punk boot)} -help [list\
"
punk boot: make any tclkits and modules in <projectdir>/src folders and place
them and associated data files/scripts in the parent folder of src - e.g in
'bin' and 'modules' folders at the same level as 'src'.
General usage: make.tcl <subcommand> ?flags?
'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' shows a
subcommand's own usage. Interactive y/n confirmations can be driven
non-interactively with the -confirm flag declared on the relevant
subcommands."]"\
{@form -synopsis "make.tcl ?subcommand? ?flags?"}\
"@leaders -min 1 -max 1"\
"subcommand -type string -optional 0 -choicecolumns 1 -choicegroups [list $SUBGROUPS] -choicelabels [list $SUMMARIES] -help\
{Use 'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' for details of a subcommand.}"
#top-level @cmd -help body (make.tcl itself is not a subcommand key, so this
#lives beside HELPTEXTS rather than in it) - same block-form/indentation
#convention as the HELPTEXTS entries
variable TOPLEVEL_HELP {
punk boot: make any tclkits and modules in <projectdir>/src folders and place
them and associated data files/scripts in the parent folder of src - e.g in
'bin' and 'modules' folders at the same level as 'src'.
General usage: make.tcl <subcommand> ?flags?
'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' shows a
subcommand's own usage. Interactive y/n confirmations can be driven
non-interactively with the -confirm flag declared on the relevant
subcommands.}
punk::args::define {
@id -id "(script)::punkboot"
@cmd -name "make.tcl" -&
-summary "punkshell project build tool (punk boot)" -&
-help -&
{${$TOPLEVEL_HELP}}
@form -synopsis "make.tcl ?subcommand? ?flags?"
@leaders -min 1 -max 1
subcommand -type string -optional 0 -choicecolumns 1 -&
-choicegroups {${$SUBGROUPS}} -&
-choicelabels {${$SUMMARIES}} -&
-help "Use 'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' for details of a subcommand."
}
#capability probe: force resolution of representative definitions now, inside
#the guarded block - a stale punk::args that accepted the raw text but cannot
#resolve a mechanism used here (e.g pre-@normalize snapshots) degrades to the
#plain fallback immediately instead of erroring at first parse/usage.
#resolve a mechanism used here (e.g snapshots predating -& record continuation
#or the G-046 display-field deferral) degrades to the plain fallback
#immediately instead of erroring at first parse/usage.
punk::args::get_spec (script)::punkboot
punk::args::get_spec (script)::punkboot::bakehouse
punk::args::get_spec (script)::punkboot::bake ;#exercises the G-121 kitname values spec (-choicerestricted mechanism)
punk::args::get_spec (script)::punkboot::help
punk::args::get_spec (script)::punkboot::shell
unset -nocomplain sub optvars defparts ov vp _mapmodel _rec _kitname_choicepart
unset -nocomplain _mapmodel _rec _g
}
} _defserr]} {
set ::punkboot::punkargs_ok 1

4
src/modules/AGENTS.md

@ -339,9 +339,9 @@ return
Before writing or generating punk::args definitions, know the mechanisms punk::args >= 0.8.x provides — reach for these instead of re-inventing indent hacks:
- **File-style (braced-literal) definitions get whole-block indent normalization automatically** — they render independently of the code block's indentation. **Constructed (string-built) definitions do not**: any multi-line value interpolated via `[list ...]`/`format`/`string map` carries its source indentation as data. The tell-tale symptom is a rendered Description/help block whose **first line is indented differently from its continuation lines** (the renderer strips at most 4 leading spaces from continuations).
- **`@normalize`** (bare directive, like `@dynamic`) is the fix for constructed definitions: author multi-line values in **block form** (newline immediately after the opening quote/brace, so the first value line is whitespace-only; content lines uniformly indented) and the resolver re-bases them (first content line fully unindented, continuations to +4, deeper relative indents preserved, whitespace-only trailing line dropped). Head-form values (content on the first line) are contractually untouched, so `@normalize` is safe to add to a definition composed of both styles. In-tree exemplars: `::punk::helptopic::define_docs` (punk.tm) and make.tcl's `::punkboot::argdoc`.
- **`@normalize`** (bare directive, like `@dynamic`) is the fix for constructed definitions: author multi-line values in **block form** (newline immediately after the opening quote/brace, so the first value line is whitespace-only; content lines uniformly indented) and the resolver re-bases them (first content line fully unindented, continuations to +4, deeper relative indents preserved, whitespace-only trailing line dropped). Head-form values (content on the first line) are contractually untouched, so `@normalize` is safe to add to a definition composed of both styles. In-tree exemplar: `::punk::helptopic::define_docs` (punk.tm).
- **`-unindentedfields {-help}`** (on argument lines and the `@cmd` directive) supports left-margin authoring as an alternative; supported and pinned by tests, but the preferred style for constructed defs is indented block form + `@normalize` (G-045 increment 2 decision).
- **`-&` record continuation** (unquoted trailing token) continues a record across lines *inside constructed strings*, where backslash-newline is consumed by the building code's own quoting; brace a literal `{-&}` to escape. Byte-identical assembly to the backslash equivalent.
- **`-&` record continuation** (unquoted trailing token) continues a record across lines *inside constructed strings*, where backslash-newline is consumed by the building code's own quoting; brace a literal `{-&}` to escape. Byte-identical assembly to the backslash equivalent. Equally valid inside braced file-style definitions: make.tcl's `::punkboot::argdoc` blocks are the in-tree exemplar - braced defs whose `-&` records pull SUMMARIES/HELPTEXTS/option fragments via tstr placeholders, with the display-field help bodies keeping their source indentation (the centred Description style, no `@normalize`).
- **Container quoting rules** (braced values fully literal; double-quoted values get Tcl backslash semantics with `$`/`[]` still literal; `\$\{...\}` for a literal placeholder) are documented in the `punk::args::define` -help — consult it rather than experimenting.
- **Script-level/constructed ids want an explicit `@form -synopsis`**: the auto-generated synopsis currently renders the definition id (e.g `(script)::punkboot::modules`), not `@cmd -name` — supply the real invocation string (G-030 lesson).
- For choice-restricted leaders/values in dispatch-style definitions, `-optional 0` is no longer needed for pointed errors: the 0.12.0 regression (a non-matching word for an *optional* choice arg fell through to a generic overflow error instead of a pointed choiceviolation - recorded in goals/archive/G-030-maketcl-punkargs.md) is fixed in punk::args 0.12.1 (G-082, achieved 2026-07-14 - goals/archive/G-082-punkargs-error-selection.md): the specific choiceviolation/typemismatch is reported when an optional argument's rejected word overflows. `-optional 0` remains semantically sound where the calling code only parses when a word is present (make.tcl's dispatch definitions keep it - they also run against bootsupport punk::args, not the fixed source module); only definitions that must parse pointedly under a snapshot of the regressed 0.12.0 still need the workaround.

409
src/modules/punk/mix/#modpod-templates-999999.0a1.0/templates/project_layouts/vendor/punk/project-0.1/src/make.tcl vendored

@ -3033,12 +3033,13 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
buildsuite "List, describe or run the defined buildsuites under src/buildsuites (zig runtime factory)"
tool "List, test or build the vendored tools under src/tools (zig) and install them to <projectdir>/bin"
}
#@cmd -help bodies for the constructed definitions below. Authored BLOCK-FORM
#(first value line whitespace-only) so the @normalize directive in each
#definition re-bases the embedded source indentation - the G-045 mechanism for
#string-built definitions, which get no automatic whole-block indent
#normalization (head-form values here would leak this file's indentation into
#the rendered Description column).
#@cmd -help bodies for the braced definitions below, pulled in via tstr
#placeholders ({${[dict get $HELPTEXTS <sub>]}}). -help is a display field,
#expanded DEFERRED (punk::args G-046) - each body lands in the rendered
#Description column verbatim, so the BLOCK-FORM authoring here (first value
#line whitespace-only, content uniformly indented) deliberately carries this
#indentation into the display: the centred Description look of the punk
#module doc blocks (no @normalize re-basing).
variable HELPTEXTS {
bakehouse
"
@ -3215,6 +3216,10 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
The text is embedded in make.tcl (::punkboot::workflow_text) so it is
available wherever make.tcl runs; its MAINTENANCE key states the
update contract for keeping it in step with build behaviour."
help
"
Show tabled usage for make.tcl as a whole, or for a single subcommand.
Equivalent to 'make.tcl <subcommand> -help'."
buildsuite
"
Surface for the defined buildsuites under src/buildsuites (zig-built
@ -3280,7 +3285,9 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
deliberately left in place between runs for rebuild speed (both
git- and fossil-ignored)."
}
#shared option fragments composed into the per-subcommand definitions below
#shared option fragments interpolated into the per-subcommand definitions
#below via tstr placeholders (${$OPT_...}) - expanded eagerly at resolve time
#in this namespace, so each definition receives these records verbatim
variable OPT_CONFIRM {
-confirm -type boolean -default 1 -help\
"Interactive y/n confirmation policy.
@ -3347,45 +3354,14 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
"Re-download and re-materialize even when a present artifact
already verifies against the server sha1sums."
}
#which shared option fragments each subcommand declares
#(shell and help have bespoke definitions below: shell passes trailing args
# through to the repl untouched, help takes a subject value)
variable SUBOPTS {
bakehouse {OPT_FORCEKILL OPT_DIRTYABORT_ON OPT_CONFIRM}
packages {OPT_DIRTYABORT OPT_CONFIRM}
modules {OPT_DIRTYABORT OPT_CONFIRM}
libs {OPT_DIRTYABORT OPT_CONFIRM}
bake {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM}
bakelist {}
vfslibs {OPT_DIRTYABORT OPT_CONFIRM}
bin {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM}
vendorupdate {OPT_CONFIRM}
libfetch {OPT_SERVERURL OPT_TRUSTSERVER OPT_FORCE}
bootsupport {OPT_DIRTYABORT OPT_CONFIRM}
vfscommonupdate {OPT_DIRTYABORT OPT_CONFIRM}
info {OPT_CONFIRM}
check {}
projectversion {}
workflow {}
}
#synopsis fragments matching the shared option fragments (explicit @form -synopsis
#so usage shows the real invocation 'make.tcl <subcommand> ...' rather than the
#internal definition id)
variable OPT_SYNOPSES {
OPT_FORCEKILL "?-k?"
OPT_DIRTYABORT "?-dirty-abort?"
OPT_DIRTYABORT_ON "?-dirty-abort 1|0?"
OPT_CONFIRM "?-confirm 0|1?"
OPT_SERVERURL "?-serverurl <url>?"
OPT_TRUSTSERVER "?-trust-server?"
OPT_FORCE "?-force?"
}
#per-subcommand positional values (default: none). bake and bakelist take
#optional kit names (G-121 selective bake).
#bake and bakelist take optional trailing kit names (G-121 selective bake).
#Discoverability nicety: the configured kit names are offered as choices when
#the mapping parses at definition time - informational only (-choicerestricted
#0), so the handlers' own validation (which lists the configured names, and
#still works when the mapping cannot be parsed here) stays authoritative.
#KITNAME_CHOICEPART persists as a namespace variable because the kitname
#records below interpolate it at definition RESOLVE time (lazy - first
#parse/usage/get_spec of the bake/bakelist ids).
variable KITNAME_CHOICES [list]
catch {
set _mapmodel [punkboot::lib::mapvfs_parse [punkboot::lib::mapvfs_locate [file join $::punkboot::scriptfolder runtime]] "" $::punkboot::scriptfolder $::punkboot::target_platform]
@ -3397,60 +3373,211 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
lappend KITNAME_CHOICES @$_g
}
}
set _kitname_choicepart ""
variable KITNAME_CHOICEPART ""
if {[llength $KITNAME_CHOICES]} {
set _kitname_choicepart " -choices [list $KITNAME_CHOICES] -choicerestricted 0"
}
variable SUBVALUES [dict create]
dict set SUBVALUES bake [list\
"@values -min 0 -max -1"\
"kitname -type string -optional 1 -multiple 1${_kitname_choicepart} -help\
{
Configured kit output(s) to bake and deploy - a kit name, or
@<groupname> for every kit in a configured group (G-024) - see
'make.tcl bakelist' for the configured names and groups. With no
kitname, all configured kits are processed except entries with
bake_default=false. An unknown name errors before any build.}"\
]
dict set SUBVALUES bakelist [list\
"@values -min 0 -max -1"\
"kitname -type string -optional 1 -multiple 1${_kitname_choicepart}\
-help\
{
Configured kit output(s) to report on - a kit name, or @<groupname>
for every kit in a configured group (filters the listing - doubles
as per-kit detail). With no kitname, all configured entries are
listed.}"\
]
variable VALUES_SYNOPSES {
bake "?kitname ...?"
bakelist "?kitname ...?"
}
foreach {sub optvars} $SUBOPTS {
set synparts [list "make.tcl $sub"]
foreach ov $optvars {
lappend synparts [dict get $OPT_SYNOPSES $ov]
}
if {[dict exists $VALUES_SYNOPSES $sub]} {
lappend synparts [dict get $VALUES_SYNOPSES $sub]
}
set defparts [list]
lappend defparts "@id -id (script)::punkboot::$sub"
lappend defparts "@normalize" ;#G-045 block-form value re-basing for constructed definitions
lappend defparts "@cmd -name [list "make.tcl $sub"] -summary [list [dict get $SUMMARIES $sub]] -help [list [dict get $HELPTEXTS $sub]]"
lappend defparts "@form -synopsis [list [join $synparts { }]]"
lappend defparts "@opts"
foreach ov $optvars {
lappend defparts [set $ov]
}
if {[dict exists $SUBVALUES $sub]} {
foreach vp [dict get $SUBVALUES $sub] {
lappend defparts $vp
}
} else {
lappend defparts "@values -min 0 -max 0"
}
punk::args::define {*}$defparts
set KITNAME_CHOICEPART " -choices [list $KITNAME_CHOICES] -choicerestricted 0"
}
#per-subcommand definitions: braced file-style blocks with -& record
#continuations (G-045). -summary values and -help bodies are pulled from
#SUMMARIES/HELPTEXTS via tstr placeholders; the shared option fragments
#(${$OPT_...}) and the kitname choice part expand eagerly at (lazy) resolve
#time in this namespace, while the -help bodies are display fields (G-046
#deferred expansion - their block indentation reaches the render verbatim).
punk::args::define {
@id -id "(script)::punkboot::bakehouse"
@cmd -name "make.tcl bakehouse" -&
-summary "${[dict get $SUMMARIES bakehouse]}" -&
-help -&
{${[dict get $HELPTEXTS bakehouse]}}
@form -synopsis "make.tcl bakehouse ?-k? ?-dirty-abort 1|0? ?-confirm 0|1?"
@opts
${$OPT_FORCEKILL}
${$OPT_DIRTYABORT_ON}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::packages"
@cmd -name "make.tcl packages" -&
-summary "${[dict get $SUMMARIES packages]}" -&
-help -&
{${[dict get $HELPTEXTS packages]}}
@form -synopsis "make.tcl packages ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::modules"
@cmd -name "make.tcl modules" -&
-summary "${[dict get $SUMMARIES modules]}" -&
-help -&
{${[dict get $HELPTEXTS modules]}}
@form -synopsis "make.tcl modules ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::libs"
@cmd -name "make.tcl libs" -&
-summary "${[dict get $SUMMARIES libs]}" -&
-help -&
{${[dict get $HELPTEXTS libs]}}
@form -synopsis "make.tcl libs ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::bake"
@cmd -name "make.tcl bake" -&
-summary "${[dict get $SUMMARIES bake]}" -&
-help -&
{${[dict get $HELPTEXTS bake]}}
@form -synopsis "make.tcl bake ?-k? ?-dirty-abort? ?-confirm 0|1? ?kitname ...?"
@opts
${$OPT_FORCEKILL}
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max -1
kitname -type string -optional 1 -multiple 1${$KITNAME_CHOICEPART} -help -&
"Configured kit output(s) to bake and deploy - a kit name, or
@<groupname> for every kit in a configured group (G-024) - see
'make.tcl bakelist' for the configured names and groups. With no
kitname, all configured kits are processed except entries with
bake_default=false. An unknown name errors before any build."
}
punk::args::define {
@id -id "(script)::punkboot::bakelist"
@cmd -name "make.tcl bakelist" -&
-summary "${[dict get $SUMMARIES bakelist]}" -&
-help -&
{${[dict get $HELPTEXTS bakelist]}}
@form -synopsis "make.tcl bakelist ?kitname ...?"
@values -min 0 -max -1
kitname -type string -optional 1 -multiple 1${$KITNAME_CHOICEPART} -help -&
"Configured kit output(s) to report on - a kit name, or @<groupname>
for every kit in a configured group (filters the listing - doubles
as per-kit detail). With no kitname, all configured entries are
listed."
}
punk::args::define {
@id -id "(script)::punkboot::vfslibs"
@cmd -name "make.tcl vfslibs" -&
-summary "${[dict get $SUMMARIES vfslibs]}" -&
-help -&
{${[dict get $HELPTEXTS vfslibs]}}
@form -synopsis "make.tcl vfslibs ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::bin"
@cmd -name "make.tcl bin" -&
-summary "${[dict get $SUMMARIES bin]}" -&
-help -&
{${[dict get $HELPTEXTS bin]}}
@form -synopsis "make.tcl bin ?-k? ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_FORCEKILL}
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::vendorupdate"
@cmd -name "make.tcl vendorupdate" -&
-summary "${[dict get $SUMMARIES vendorupdate]}" -&
-help -&
{${[dict get $HELPTEXTS vendorupdate]}}
@form -synopsis "make.tcl vendorupdate ?-confirm 0|1?"
@opts
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::libfetch"
@cmd -name "make.tcl libfetch" -&
-summary "${[dict get $SUMMARIES libfetch]}" -&
-help -&
{${[dict get $HELPTEXTS libfetch]}}
@form -synopsis "make.tcl libfetch ?-serverurl <url>? ?-trust-server? ?-force?"
@opts
${$OPT_SERVERURL}
${$OPT_TRUSTSERVER}
${$OPT_FORCE}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::bootsupport"
@cmd -name "make.tcl bootsupport" -&
-summary "${[dict get $SUMMARIES bootsupport]}" -&
-help -&
{${[dict get $HELPTEXTS bootsupport]}}
@form -synopsis "make.tcl bootsupport ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::vfscommonupdate"
@cmd -name "make.tcl vfscommonupdate" -&
-summary "${[dict get $SUMMARIES vfscommonupdate]}" -&
-help -&
{${[dict get $HELPTEXTS vfscommonupdate]}}
@form -synopsis "make.tcl vfscommonupdate ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::info"
@cmd -name "make.tcl info" -&
-summary "${[dict get $SUMMARIES info]}" -&
-help -&
{${[dict get $HELPTEXTS info]}}
@form -synopsis "make.tcl info ?-confirm 0|1?"
@opts
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::check"
@cmd -name "make.tcl check" -&
-summary "${[dict get $SUMMARIES check]}" -&
-help -&
{${[dict get $HELPTEXTS check]}}
@form -synopsis "make.tcl check"
@opts
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::projectversion"
@cmd -name "make.tcl projectversion" -&
-summary "${[dict get $SUMMARIES projectversion]}" -&
-help -&
{${[dict get $HELPTEXTS projectversion]}}
@form -synopsis "make.tcl projectversion"
@opts
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::workflow"
@cmd -name "make.tcl workflow" -&
-summary "${[dict get $SUMMARIES workflow]}" -&
-help -&
{${[dict get $HELPTEXTS workflow]}}
@form -synopsis "make.tcl workflow"
@opts
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::shell"
@ -3465,15 +3592,18 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
arg -type any -optional 1 -multiple 1 -help -&
"Arguments passed through to the punk repl."
}
punk::args::define\
"@id -id (script)::punkboot::buildsuite"\
"@normalize"\
"@cmd -name [list "make.tcl buildsuite"] -summary [list [dict get $SUMMARIES buildsuite]] -help [list [dict get $HELPTEXTS buildsuite]]"\
{@form -synopsis "make.tcl buildsuite list|info|build ?<suitename>? ?driver-args ...?"}\
{@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help\
punk::args::define {
@id -id "(script)::punkboot::buildsuite"
@cmd -name "make.tcl buildsuite" -&
-summary "${[dict get $SUMMARIES buildsuite]}" -&
-help -&
{${[dict get $HELPTEXTS buildsuite]}}
@form -synopsis "make.tcl buildsuite list|info|build ?<suitename>? ?driver-args ...?"
@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help -&
"Action (list|info|build), suite name, and - for build - driver
arguments forwarded to the suite's suite.tcl untouched."}
arguments forwarded to the suite's suite.tcl untouched."
}
punk::args::define {
@id -id "(script)::punkboot::tool"
@ -3488,16 +3618,18 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
the -test 0|1 gate flag. Parsed by the handler."
}
punk::args::define\
"@id -id (script)::punkboot::help"\
"@normalize"\
"@cmd -name [list "make.tcl help"] -summary [list [dict get $SUMMARIES help]] -help [list\
"
Show tabled usage for make.tcl as a whole, or for a single subcommand.
Equivalent to 'make.tcl <subcommand> -help'."]"\
{@form -synopsis "make.tcl help ?subcommand?"}\
"@values -min 1 -max 1"\
"subject -type string -optional 0 -choices [list [dict keys $SUMMARIES]] -help {Subcommand to show usage for.}"
punk::args::define {
@id -id "(script)::punkboot::help"
@cmd -name "make.tcl help" -&
-summary "${[dict get $SUMMARIES help]}" -&
-help -&
{${[dict get $HELPTEXTS help]}}
@form -synopsis "make.tcl help ?subcommand?"
@values -min 1 -max 1
subject -type string -optional 0 -&
-choices {${[dict keys $SUMMARIES]}} -&
-help "Subcommand to show usage for."
}
#top-level definition: the subcommand table rendered by 'make.tcl' / 'make.tcl -help'
variable SUBGROUPS {
"build & bake" {bakehouse packages modules libs bake vfslibs bin}
@ -3508,34 +3640,43 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
"informational" {info check bakelist projectversion workflow help}
"interactive" {shell}
}
punk::args::define\
"@id -id (script)::punkboot"\
"@normalize"\
"@cmd -name make.tcl -summary {punkshell project build tool (punk boot)} -help [list\
"
punk boot: make any tclkits and modules in <projectdir>/src folders and place
them and associated data files/scripts in the parent folder of src - e.g in
'bin' and 'modules' folders at the same level as 'src'.
General usage: make.tcl <subcommand> ?flags?
'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' shows a
subcommand's own usage. Interactive y/n confirmations can be driven
non-interactively with the -confirm flag declared on the relevant
subcommands."]"\
{@form -synopsis "make.tcl ?subcommand? ?flags?"}\
"@leaders -min 1 -max 1"\
"subcommand -type string -optional 0 -choicecolumns 1 -choicegroups [list $SUBGROUPS] -choicelabels [list $SUMMARIES] -help\
{Use 'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' for details of a subcommand.}"
#top-level @cmd -help body (make.tcl itself is not a subcommand key, so this
#lives beside HELPTEXTS rather than in it) - same block-form/indentation
#convention as the HELPTEXTS entries
variable TOPLEVEL_HELP {
punk boot: make any tclkits and modules in <projectdir>/src folders and place
them and associated data files/scripts in the parent folder of src - e.g in
'bin' and 'modules' folders at the same level as 'src'.
General usage: make.tcl <subcommand> ?flags?
'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' shows a
subcommand's own usage. Interactive y/n confirmations can be driven
non-interactively with the -confirm flag declared on the relevant
subcommands.}
punk::args::define {
@id -id "(script)::punkboot"
@cmd -name "make.tcl" -&
-summary "punkshell project build tool (punk boot)" -&
-help -&
{${$TOPLEVEL_HELP}}
@form -synopsis "make.tcl ?subcommand? ?flags?"
@leaders -min 1 -max 1
subcommand -type string -optional 0 -choicecolumns 1 -&
-choicegroups {${$SUBGROUPS}} -&
-choicelabels {${$SUMMARIES}} -&
-help "Use 'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' for details of a subcommand."
}
#capability probe: force resolution of representative definitions now, inside
#the guarded block - a stale punk::args that accepted the raw text but cannot
#resolve a mechanism used here (e.g pre-@normalize snapshots) degrades to the
#plain fallback immediately instead of erroring at first parse/usage.
#resolve a mechanism used here (e.g snapshots predating -& record continuation
#or the G-046 display-field deferral) degrades to the plain fallback
#immediately instead of erroring at first parse/usage.
punk::args::get_spec (script)::punkboot
punk::args::get_spec (script)::punkboot::bakehouse
punk::args::get_spec (script)::punkboot::bake ;#exercises the G-121 kitname values spec (-choicerestricted mechanism)
punk::args::get_spec (script)::punkboot::help
punk::args::get_spec (script)::punkboot::shell
unset -nocomplain sub optvars defparts ov vp _mapmodel _rec _kitname_choicepart
unset -nocomplain _mapmodel _rec _g
}
} _defserr]} {
set ::punkboot::punkargs_ok 1

409
src/project_layouts/vendor/punk/basic/src/make.tcl vendored

@ -3033,12 +3033,13 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
buildsuite "List, describe or run the defined buildsuites under src/buildsuites (zig runtime factory)"
tool "List, test or build the vendored tools under src/tools (zig) and install them to <projectdir>/bin"
}
#@cmd -help bodies for the constructed definitions below. Authored BLOCK-FORM
#(first value line whitespace-only) so the @normalize directive in each
#definition re-bases the embedded source indentation - the G-045 mechanism for
#string-built definitions, which get no automatic whole-block indent
#normalization (head-form values here would leak this file's indentation into
#the rendered Description column).
#@cmd -help bodies for the braced definitions below, pulled in via tstr
#placeholders ({${[dict get $HELPTEXTS <sub>]}}). -help is a display field,
#expanded DEFERRED (punk::args G-046) - each body lands in the rendered
#Description column verbatim, so the BLOCK-FORM authoring here (first value
#line whitespace-only, content uniformly indented) deliberately carries this
#indentation into the display: the centred Description look of the punk
#module doc blocks (no @normalize re-basing).
variable HELPTEXTS {
bakehouse
"
@ -3215,6 +3216,10 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
The text is embedded in make.tcl (::punkboot::workflow_text) so it is
available wherever make.tcl runs; its MAINTENANCE key states the
update contract for keeping it in step with build behaviour."
help
"
Show tabled usage for make.tcl as a whole, or for a single subcommand.
Equivalent to 'make.tcl <subcommand> -help'."
buildsuite
"
Surface for the defined buildsuites under src/buildsuites (zig-built
@ -3280,7 +3285,9 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
deliberately left in place between runs for rebuild speed (both
git- and fossil-ignored)."
}
#shared option fragments composed into the per-subcommand definitions below
#shared option fragments interpolated into the per-subcommand definitions
#below via tstr placeholders (${$OPT_...}) - expanded eagerly at resolve time
#in this namespace, so each definition receives these records verbatim
variable OPT_CONFIRM {
-confirm -type boolean -default 1 -help\
"Interactive y/n confirmation policy.
@ -3347,45 +3354,14 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
"Re-download and re-materialize even when a present artifact
already verifies against the server sha1sums."
}
#which shared option fragments each subcommand declares
#(shell and help have bespoke definitions below: shell passes trailing args
# through to the repl untouched, help takes a subject value)
variable SUBOPTS {
bakehouse {OPT_FORCEKILL OPT_DIRTYABORT_ON OPT_CONFIRM}
packages {OPT_DIRTYABORT OPT_CONFIRM}
modules {OPT_DIRTYABORT OPT_CONFIRM}
libs {OPT_DIRTYABORT OPT_CONFIRM}
bake {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM}
bakelist {}
vfslibs {OPT_DIRTYABORT OPT_CONFIRM}
bin {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM}
vendorupdate {OPT_CONFIRM}
libfetch {OPT_SERVERURL OPT_TRUSTSERVER OPT_FORCE}
bootsupport {OPT_DIRTYABORT OPT_CONFIRM}
vfscommonupdate {OPT_DIRTYABORT OPT_CONFIRM}
info {OPT_CONFIRM}
check {}
projectversion {}
workflow {}
}
#synopsis fragments matching the shared option fragments (explicit @form -synopsis
#so usage shows the real invocation 'make.tcl <subcommand> ...' rather than the
#internal definition id)
variable OPT_SYNOPSES {
OPT_FORCEKILL "?-k?"
OPT_DIRTYABORT "?-dirty-abort?"
OPT_DIRTYABORT_ON "?-dirty-abort 1|0?"
OPT_CONFIRM "?-confirm 0|1?"
OPT_SERVERURL "?-serverurl <url>?"
OPT_TRUSTSERVER "?-trust-server?"
OPT_FORCE "?-force?"
}
#per-subcommand positional values (default: none). bake and bakelist take
#optional kit names (G-121 selective bake).
#bake and bakelist take optional trailing kit names (G-121 selective bake).
#Discoverability nicety: the configured kit names are offered as choices when
#the mapping parses at definition time - informational only (-choicerestricted
#0), so the handlers' own validation (which lists the configured names, and
#still works when the mapping cannot be parsed here) stays authoritative.
#KITNAME_CHOICEPART persists as a namespace variable because the kitname
#records below interpolate it at definition RESOLVE time (lazy - first
#parse/usage/get_spec of the bake/bakelist ids).
variable KITNAME_CHOICES [list]
catch {
set _mapmodel [punkboot::lib::mapvfs_parse [punkboot::lib::mapvfs_locate [file join $::punkboot::scriptfolder runtime]] "" $::punkboot::scriptfolder $::punkboot::target_platform]
@ -3397,60 +3373,211 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
lappend KITNAME_CHOICES @$_g
}
}
set _kitname_choicepart ""
variable KITNAME_CHOICEPART ""
if {[llength $KITNAME_CHOICES]} {
set _kitname_choicepart " -choices [list $KITNAME_CHOICES] -choicerestricted 0"
}
variable SUBVALUES [dict create]
dict set SUBVALUES bake [list\
"@values -min 0 -max -1"\
"kitname -type string -optional 1 -multiple 1${_kitname_choicepart} -help\
{
Configured kit output(s) to bake and deploy - a kit name, or
@<groupname> for every kit in a configured group (G-024) - see
'make.tcl bakelist' for the configured names and groups. With no
kitname, all configured kits are processed except entries with
bake_default=false. An unknown name errors before any build.}"\
]
dict set SUBVALUES bakelist [list\
"@values -min 0 -max -1"\
"kitname -type string -optional 1 -multiple 1${_kitname_choicepart}\
-help\
{
Configured kit output(s) to report on - a kit name, or @<groupname>
for every kit in a configured group (filters the listing - doubles
as per-kit detail). With no kitname, all configured entries are
listed.}"\
]
variable VALUES_SYNOPSES {
bake "?kitname ...?"
bakelist "?kitname ...?"
}
foreach {sub optvars} $SUBOPTS {
set synparts [list "make.tcl $sub"]
foreach ov $optvars {
lappend synparts [dict get $OPT_SYNOPSES $ov]
}
if {[dict exists $VALUES_SYNOPSES $sub]} {
lappend synparts [dict get $VALUES_SYNOPSES $sub]
}
set defparts [list]
lappend defparts "@id -id (script)::punkboot::$sub"
lappend defparts "@normalize" ;#G-045 block-form value re-basing for constructed definitions
lappend defparts "@cmd -name [list "make.tcl $sub"] -summary [list [dict get $SUMMARIES $sub]] -help [list [dict get $HELPTEXTS $sub]]"
lappend defparts "@form -synopsis [list [join $synparts { }]]"
lappend defparts "@opts"
foreach ov $optvars {
lappend defparts [set $ov]
}
if {[dict exists $SUBVALUES $sub]} {
foreach vp [dict get $SUBVALUES $sub] {
lappend defparts $vp
}
} else {
lappend defparts "@values -min 0 -max 0"
}
punk::args::define {*}$defparts
set KITNAME_CHOICEPART " -choices [list $KITNAME_CHOICES] -choicerestricted 0"
}
#per-subcommand definitions: braced file-style blocks with -& record
#continuations (G-045). -summary values and -help bodies are pulled from
#SUMMARIES/HELPTEXTS via tstr placeholders; the shared option fragments
#(${$OPT_...}) and the kitname choice part expand eagerly at (lazy) resolve
#time in this namespace, while the -help bodies are display fields (G-046
#deferred expansion - their block indentation reaches the render verbatim).
punk::args::define {
@id -id "(script)::punkboot::bakehouse"
@cmd -name "make.tcl bakehouse" -&
-summary "${[dict get $SUMMARIES bakehouse]}" -&
-help -&
{${[dict get $HELPTEXTS bakehouse]}}
@form -synopsis "make.tcl bakehouse ?-k? ?-dirty-abort 1|0? ?-confirm 0|1?"
@opts
${$OPT_FORCEKILL}
${$OPT_DIRTYABORT_ON}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::packages"
@cmd -name "make.tcl packages" -&
-summary "${[dict get $SUMMARIES packages]}" -&
-help -&
{${[dict get $HELPTEXTS packages]}}
@form -synopsis "make.tcl packages ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::modules"
@cmd -name "make.tcl modules" -&
-summary "${[dict get $SUMMARIES modules]}" -&
-help -&
{${[dict get $HELPTEXTS modules]}}
@form -synopsis "make.tcl modules ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::libs"
@cmd -name "make.tcl libs" -&
-summary "${[dict get $SUMMARIES libs]}" -&
-help -&
{${[dict get $HELPTEXTS libs]}}
@form -synopsis "make.tcl libs ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::bake"
@cmd -name "make.tcl bake" -&
-summary "${[dict get $SUMMARIES bake]}" -&
-help -&
{${[dict get $HELPTEXTS bake]}}
@form -synopsis "make.tcl bake ?-k? ?-dirty-abort? ?-confirm 0|1? ?kitname ...?"
@opts
${$OPT_FORCEKILL}
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max -1
kitname -type string -optional 1 -multiple 1${$KITNAME_CHOICEPART} -help -&
"Configured kit output(s) to bake and deploy - a kit name, or
@<groupname> for every kit in a configured group (G-024) - see
'make.tcl bakelist' for the configured names and groups. With no
kitname, all configured kits are processed except entries with
bake_default=false. An unknown name errors before any build."
}
punk::args::define {
@id -id "(script)::punkboot::bakelist"
@cmd -name "make.tcl bakelist" -&
-summary "${[dict get $SUMMARIES bakelist]}" -&
-help -&
{${[dict get $HELPTEXTS bakelist]}}
@form -synopsis "make.tcl bakelist ?kitname ...?"
@values -min 0 -max -1
kitname -type string -optional 1 -multiple 1${$KITNAME_CHOICEPART} -help -&
"Configured kit output(s) to report on - a kit name, or @<groupname>
for every kit in a configured group (filters the listing - doubles
as per-kit detail). With no kitname, all configured entries are
listed."
}
punk::args::define {
@id -id "(script)::punkboot::vfslibs"
@cmd -name "make.tcl vfslibs" -&
-summary "${[dict get $SUMMARIES vfslibs]}" -&
-help -&
{${[dict get $HELPTEXTS vfslibs]}}
@form -synopsis "make.tcl vfslibs ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::bin"
@cmd -name "make.tcl bin" -&
-summary "${[dict get $SUMMARIES bin]}" -&
-help -&
{${[dict get $HELPTEXTS bin]}}
@form -synopsis "make.tcl bin ?-k? ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_FORCEKILL}
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::vendorupdate"
@cmd -name "make.tcl vendorupdate" -&
-summary "${[dict get $SUMMARIES vendorupdate]}" -&
-help -&
{${[dict get $HELPTEXTS vendorupdate]}}
@form -synopsis "make.tcl vendorupdate ?-confirm 0|1?"
@opts
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::libfetch"
@cmd -name "make.tcl libfetch" -&
-summary "${[dict get $SUMMARIES libfetch]}" -&
-help -&
{${[dict get $HELPTEXTS libfetch]}}
@form -synopsis "make.tcl libfetch ?-serverurl <url>? ?-trust-server? ?-force?"
@opts
${$OPT_SERVERURL}
${$OPT_TRUSTSERVER}
${$OPT_FORCE}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::bootsupport"
@cmd -name "make.tcl bootsupport" -&
-summary "${[dict get $SUMMARIES bootsupport]}" -&
-help -&
{${[dict get $HELPTEXTS bootsupport]}}
@form -synopsis "make.tcl bootsupport ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::vfscommonupdate"
@cmd -name "make.tcl vfscommonupdate" -&
-summary "${[dict get $SUMMARIES vfscommonupdate]}" -&
-help -&
{${[dict get $HELPTEXTS vfscommonupdate]}}
@form -synopsis "make.tcl vfscommonupdate ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::info"
@cmd -name "make.tcl info" -&
-summary "${[dict get $SUMMARIES info]}" -&
-help -&
{${[dict get $HELPTEXTS info]}}
@form -synopsis "make.tcl info ?-confirm 0|1?"
@opts
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::check"
@cmd -name "make.tcl check" -&
-summary "${[dict get $SUMMARIES check]}" -&
-help -&
{${[dict get $HELPTEXTS check]}}
@form -synopsis "make.tcl check"
@opts
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::projectversion"
@cmd -name "make.tcl projectversion" -&
-summary "${[dict get $SUMMARIES projectversion]}" -&
-help -&
{${[dict get $HELPTEXTS projectversion]}}
@form -synopsis "make.tcl projectversion"
@opts
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::workflow"
@cmd -name "make.tcl workflow" -&
-summary "${[dict get $SUMMARIES workflow]}" -&
-help -&
{${[dict get $HELPTEXTS workflow]}}
@form -synopsis "make.tcl workflow"
@opts
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::shell"
@ -3465,15 +3592,18 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
arg -type any -optional 1 -multiple 1 -help -&
"Arguments passed through to the punk repl."
}
punk::args::define\
"@id -id (script)::punkboot::buildsuite"\
"@normalize"\
"@cmd -name [list "make.tcl buildsuite"] -summary [list [dict get $SUMMARIES buildsuite]] -help [list [dict get $HELPTEXTS buildsuite]]"\
{@form -synopsis "make.tcl buildsuite list|info|build ?<suitename>? ?driver-args ...?"}\
{@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help\
punk::args::define {
@id -id "(script)::punkboot::buildsuite"
@cmd -name "make.tcl buildsuite" -&
-summary "${[dict get $SUMMARIES buildsuite]}" -&
-help -&
{${[dict get $HELPTEXTS buildsuite]}}
@form -synopsis "make.tcl buildsuite list|info|build ?<suitename>? ?driver-args ...?"
@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help -&
"Action (list|info|build), suite name, and - for build - driver
arguments forwarded to the suite's suite.tcl untouched."}
arguments forwarded to the suite's suite.tcl untouched."
}
punk::args::define {
@id -id "(script)::punkboot::tool"
@ -3488,16 +3618,18 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
the -test 0|1 gate flag. Parsed by the handler."
}
punk::args::define\
"@id -id (script)::punkboot::help"\
"@normalize"\
"@cmd -name [list "make.tcl help"] -summary [list [dict get $SUMMARIES help]] -help [list\
"
Show tabled usage for make.tcl as a whole, or for a single subcommand.
Equivalent to 'make.tcl <subcommand> -help'."]"\
{@form -synopsis "make.tcl help ?subcommand?"}\
"@values -min 1 -max 1"\
"subject -type string -optional 0 -choices [list [dict keys $SUMMARIES]] -help {Subcommand to show usage for.}"
punk::args::define {
@id -id "(script)::punkboot::help"
@cmd -name "make.tcl help" -&
-summary "${[dict get $SUMMARIES help]}" -&
-help -&
{${[dict get $HELPTEXTS help]}}
@form -synopsis "make.tcl help ?subcommand?"
@values -min 1 -max 1
subject -type string -optional 0 -&
-choices {${[dict keys $SUMMARIES]}} -&
-help "Subcommand to show usage for."
}
#top-level definition: the subcommand table rendered by 'make.tcl' / 'make.tcl -help'
variable SUBGROUPS {
"build & bake" {bakehouse packages modules libs bake vfslibs bin}
@ -3508,34 +3640,43 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
"informational" {info check bakelist projectversion workflow help}
"interactive" {shell}
}
punk::args::define\
"@id -id (script)::punkboot"\
"@normalize"\
"@cmd -name make.tcl -summary {punkshell project build tool (punk boot)} -help [list\
"
punk boot: make any tclkits and modules in <projectdir>/src folders and place
them and associated data files/scripts in the parent folder of src - e.g in
'bin' and 'modules' folders at the same level as 'src'.
General usage: make.tcl <subcommand> ?flags?
'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' shows a
subcommand's own usage. Interactive y/n confirmations can be driven
non-interactively with the -confirm flag declared on the relevant
subcommands."]"\
{@form -synopsis "make.tcl ?subcommand? ?flags?"}\
"@leaders -min 1 -max 1"\
"subcommand -type string -optional 0 -choicecolumns 1 -choicegroups [list $SUBGROUPS] -choicelabels [list $SUMMARIES] -help\
{Use 'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' for details of a subcommand.}"
#top-level @cmd -help body (make.tcl itself is not a subcommand key, so this
#lives beside HELPTEXTS rather than in it) - same block-form/indentation
#convention as the HELPTEXTS entries
variable TOPLEVEL_HELP {
punk boot: make any tclkits and modules in <projectdir>/src folders and place
them and associated data files/scripts in the parent folder of src - e.g in
'bin' and 'modules' folders at the same level as 'src'.
General usage: make.tcl <subcommand> ?flags?
'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' shows a
subcommand's own usage. Interactive y/n confirmations can be driven
non-interactively with the -confirm flag declared on the relevant
subcommands.}
punk::args::define {
@id -id "(script)::punkboot"
@cmd -name "make.tcl" -&
-summary "punkshell project build tool (punk boot)" -&
-help -&
{${$TOPLEVEL_HELP}}
@form -synopsis "make.tcl ?subcommand? ?flags?"
@leaders -min 1 -max 1
subcommand -type string -optional 0 -choicecolumns 1 -&
-choicegroups {${$SUBGROUPS}} -&
-choicelabels {${$SUMMARIES}} -&
-help "Use 'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' for details of a subcommand."
}
#capability probe: force resolution of representative definitions now, inside
#the guarded block - a stale punk::args that accepted the raw text but cannot
#resolve a mechanism used here (e.g pre-@normalize snapshots) degrades to the
#plain fallback immediately instead of erroring at first parse/usage.
#resolve a mechanism used here (e.g snapshots predating -& record continuation
#or the G-046 display-field deferral) degrades to the plain fallback
#immediately instead of erroring at first parse/usage.
punk::args::get_spec (script)::punkboot
punk::args::get_spec (script)::punkboot::bakehouse
punk::args::get_spec (script)::punkboot::bake ;#exercises the G-121 kitname values spec (-choicerestricted mechanism)
punk::args::get_spec (script)::punkboot::help
punk::args::get_spec (script)::punkboot::shell
unset -nocomplain sub optvars defparts ov vp _mapmodel _rec _kitname_choicepart
unset -nocomplain _mapmodel _rec _g
}
} _defserr]} {
set ::punkboot::punkargs_ok 1

409
src/project_layouts/vendor/punk/project-0.1/src/make.tcl vendored

@ -3033,12 +3033,13 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
buildsuite "List, describe or run the defined buildsuites under src/buildsuites (zig runtime factory)"
tool "List, test or build the vendored tools under src/tools (zig) and install them to <projectdir>/bin"
}
#@cmd -help bodies for the constructed definitions below. Authored BLOCK-FORM
#(first value line whitespace-only) so the @normalize directive in each
#definition re-bases the embedded source indentation - the G-045 mechanism for
#string-built definitions, which get no automatic whole-block indent
#normalization (head-form values here would leak this file's indentation into
#the rendered Description column).
#@cmd -help bodies for the braced definitions below, pulled in via tstr
#placeholders ({${[dict get $HELPTEXTS <sub>]}}). -help is a display field,
#expanded DEFERRED (punk::args G-046) - each body lands in the rendered
#Description column verbatim, so the BLOCK-FORM authoring here (first value
#line whitespace-only, content uniformly indented) deliberately carries this
#indentation into the display: the centred Description look of the punk
#module doc blocks (no @normalize re-basing).
variable HELPTEXTS {
bakehouse
"
@ -3215,6 +3216,10 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
The text is embedded in make.tcl (::punkboot::workflow_text) so it is
available wherever make.tcl runs; its MAINTENANCE key states the
update contract for keeping it in step with build behaviour."
help
"
Show tabled usage for make.tcl as a whole, or for a single subcommand.
Equivalent to 'make.tcl <subcommand> -help'."
buildsuite
"
Surface for the defined buildsuites under src/buildsuites (zig-built
@ -3280,7 +3285,9 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
deliberately left in place between runs for rebuild speed (both
git- and fossil-ignored)."
}
#shared option fragments composed into the per-subcommand definitions below
#shared option fragments interpolated into the per-subcommand definitions
#below via tstr placeholders (${$OPT_...}) - expanded eagerly at resolve time
#in this namespace, so each definition receives these records verbatim
variable OPT_CONFIRM {
-confirm -type boolean -default 1 -help\
"Interactive y/n confirmation policy.
@ -3347,45 +3354,14 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
"Re-download and re-materialize even when a present artifact
already verifies against the server sha1sums."
}
#which shared option fragments each subcommand declares
#(shell and help have bespoke definitions below: shell passes trailing args
# through to the repl untouched, help takes a subject value)
variable SUBOPTS {
bakehouse {OPT_FORCEKILL OPT_DIRTYABORT_ON OPT_CONFIRM}
packages {OPT_DIRTYABORT OPT_CONFIRM}
modules {OPT_DIRTYABORT OPT_CONFIRM}
libs {OPT_DIRTYABORT OPT_CONFIRM}
bake {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM}
bakelist {}
vfslibs {OPT_DIRTYABORT OPT_CONFIRM}
bin {OPT_FORCEKILL OPT_DIRTYABORT OPT_CONFIRM}
vendorupdate {OPT_CONFIRM}
libfetch {OPT_SERVERURL OPT_TRUSTSERVER OPT_FORCE}
bootsupport {OPT_DIRTYABORT OPT_CONFIRM}
vfscommonupdate {OPT_DIRTYABORT OPT_CONFIRM}
info {OPT_CONFIRM}
check {}
projectversion {}
workflow {}
}
#synopsis fragments matching the shared option fragments (explicit @form -synopsis
#so usage shows the real invocation 'make.tcl <subcommand> ...' rather than the
#internal definition id)
variable OPT_SYNOPSES {
OPT_FORCEKILL "?-k?"
OPT_DIRTYABORT "?-dirty-abort?"
OPT_DIRTYABORT_ON "?-dirty-abort 1|0?"
OPT_CONFIRM "?-confirm 0|1?"
OPT_SERVERURL "?-serverurl <url>?"
OPT_TRUSTSERVER "?-trust-server?"
OPT_FORCE "?-force?"
}
#per-subcommand positional values (default: none). bake and bakelist take
#optional kit names (G-121 selective bake).
#bake and bakelist take optional trailing kit names (G-121 selective bake).
#Discoverability nicety: the configured kit names are offered as choices when
#the mapping parses at definition time - informational only (-choicerestricted
#0), so the handlers' own validation (which lists the configured names, and
#still works when the mapping cannot be parsed here) stays authoritative.
#KITNAME_CHOICEPART persists as a namespace variable because the kitname
#records below interpolate it at definition RESOLVE time (lazy - first
#parse/usage/get_spec of the bake/bakelist ids).
variable KITNAME_CHOICES [list]
catch {
set _mapmodel [punkboot::lib::mapvfs_parse [punkboot::lib::mapvfs_locate [file join $::punkboot::scriptfolder runtime]] "" $::punkboot::scriptfolder $::punkboot::target_platform]
@ -3397,60 +3373,211 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
lappend KITNAME_CHOICES @$_g
}
}
set _kitname_choicepart ""
variable KITNAME_CHOICEPART ""
if {[llength $KITNAME_CHOICES]} {
set _kitname_choicepart " -choices [list $KITNAME_CHOICES] -choicerestricted 0"
}
variable SUBVALUES [dict create]
dict set SUBVALUES bake [list\
"@values -min 0 -max -1"\
"kitname -type string -optional 1 -multiple 1${_kitname_choicepart} -help\
{
Configured kit output(s) to bake and deploy - a kit name, or
@<groupname> for every kit in a configured group (G-024) - see
'make.tcl bakelist' for the configured names and groups. With no
kitname, all configured kits are processed except entries with
bake_default=false. An unknown name errors before any build.}"\
]
dict set SUBVALUES bakelist [list\
"@values -min 0 -max -1"\
"kitname -type string -optional 1 -multiple 1${_kitname_choicepart}\
-help\
{
Configured kit output(s) to report on - a kit name, or @<groupname>
for every kit in a configured group (filters the listing - doubles
as per-kit detail). With no kitname, all configured entries are
listed.}"\
]
variable VALUES_SYNOPSES {
bake "?kitname ...?"
bakelist "?kitname ...?"
}
foreach {sub optvars} $SUBOPTS {
set synparts [list "make.tcl $sub"]
foreach ov $optvars {
lappend synparts [dict get $OPT_SYNOPSES $ov]
}
if {[dict exists $VALUES_SYNOPSES $sub]} {
lappend synparts [dict get $VALUES_SYNOPSES $sub]
}
set defparts [list]
lappend defparts "@id -id (script)::punkboot::$sub"
lappend defparts "@normalize" ;#G-045 block-form value re-basing for constructed definitions
lappend defparts "@cmd -name [list "make.tcl $sub"] -summary [list [dict get $SUMMARIES $sub]] -help [list [dict get $HELPTEXTS $sub]]"
lappend defparts "@form -synopsis [list [join $synparts { }]]"
lappend defparts "@opts"
foreach ov $optvars {
lappend defparts [set $ov]
}
if {[dict exists $SUBVALUES $sub]} {
foreach vp [dict get $SUBVALUES $sub] {
lappend defparts $vp
}
} else {
lappend defparts "@values -min 0 -max 0"
}
punk::args::define {*}$defparts
set KITNAME_CHOICEPART " -choices [list $KITNAME_CHOICES] -choicerestricted 0"
}
#per-subcommand definitions: braced file-style blocks with -& record
#continuations (G-045). -summary values and -help bodies are pulled from
#SUMMARIES/HELPTEXTS via tstr placeholders; the shared option fragments
#(${$OPT_...}) and the kitname choice part expand eagerly at (lazy) resolve
#time in this namespace, while the -help bodies are display fields (G-046
#deferred expansion - their block indentation reaches the render verbatim).
punk::args::define {
@id -id "(script)::punkboot::bakehouse"
@cmd -name "make.tcl bakehouse" -&
-summary "${[dict get $SUMMARIES bakehouse]}" -&
-help -&
{${[dict get $HELPTEXTS bakehouse]}}
@form -synopsis "make.tcl bakehouse ?-k? ?-dirty-abort 1|0? ?-confirm 0|1?"
@opts
${$OPT_FORCEKILL}
${$OPT_DIRTYABORT_ON}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::packages"
@cmd -name "make.tcl packages" -&
-summary "${[dict get $SUMMARIES packages]}" -&
-help -&
{${[dict get $HELPTEXTS packages]}}
@form -synopsis "make.tcl packages ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::modules"
@cmd -name "make.tcl modules" -&
-summary "${[dict get $SUMMARIES modules]}" -&
-help -&
{${[dict get $HELPTEXTS modules]}}
@form -synopsis "make.tcl modules ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::libs"
@cmd -name "make.tcl libs" -&
-summary "${[dict get $SUMMARIES libs]}" -&
-help -&
{${[dict get $HELPTEXTS libs]}}
@form -synopsis "make.tcl libs ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::bake"
@cmd -name "make.tcl bake" -&
-summary "${[dict get $SUMMARIES bake]}" -&
-help -&
{${[dict get $HELPTEXTS bake]}}
@form -synopsis "make.tcl bake ?-k? ?-dirty-abort? ?-confirm 0|1? ?kitname ...?"
@opts
${$OPT_FORCEKILL}
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max -1
kitname -type string -optional 1 -multiple 1${$KITNAME_CHOICEPART} -help -&
"Configured kit output(s) to bake and deploy - a kit name, or
@<groupname> for every kit in a configured group (G-024) - see
'make.tcl bakelist' for the configured names and groups. With no
kitname, all configured kits are processed except entries with
bake_default=false. An unknown name errors before any build."
}
punk::args::define {
@id -id "(script)::punkboot::bakelist"
@cmd -name "make.tcl bakelist" -&
-summary "${[dict get $SUMMARIES bakelist]}" -&
-help -&
{${[dict get $HELPTEXTS bakelist]}}
@form -synopsis "make.tcl bakelist ?kitname ...?"
@values -min 0 -max -1
kitname -type string -optional 1 -multiple 1${$KITNAME_CHOICEPART} -help -&
"Configured kit output(s) to report on - a kit name, or @<groupname>
for every kit in a configured group (filters the listing - doubles
as per-kit detail). With no kitname, all configured entries are
listed."
}
punk::args::define {
@id -id "(script)::punkboot::vfslibs"
@cmd -name "make.tcl vfslibs" -&
-summary "${[dict get $SUMMARIES vfslibs]}" -&
-help -&
{${[dict get $HELPTEXTS vfslibs]}}
@form -synopsis "make.tcl vfslibs ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::bin"
@cmd -name "make.tcl bin" -&
-summary "${[dict get $SUMMARIES bin]}" -&
-help -&
{${[dict get $HELPTEXTS bin]}}
@form -synopsis "make.tcl bin ?-k? ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_FORCEKILL}
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::vendorupdate"
@cmd -name "make.tcl vendorupdate" -&
-summary "${[dict get $SUMMARIES vendorupdate]}" -&
-help -&
{${[dict get $HELPTEXTS vendorupdate]}}
@form -synopsis "make.tcl vendorupdate ?-confirm 0|1?"
@opts
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::libfetch"
@cmd -name "make.tcl libfetch" -&
-summary "${[dict get $SUMMARIES libfetch]}" -&
-help -&
{${[dict get $HELPTEXTS libfetch]}}
@form -synopsis "make.tcl libfetch ?-serverurl <url>? ?-trust-server? ?-force?"
@opts
${$OPT_SERVERURL}
${$OPT_TRUSTSERVER}
${$OPT_FORCE}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::bootsupport"
@cmd -name "make.tcl bootsupport" -&
-summary "${[dict get $SUMMARIES bootsupport]}" -&
-help -&
{${[dict get $HELPTEXTS bootsupport]}}
@form -synopsis "make.tcl bootsupport ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::vfscommonupdate"
@cmd -name "make.tcl vfscommonupdate" -&
-summary "${[dict get $SUMMARIES vfscommonupdate]}" -&
-help -&
{${[dict get $HELPTEXTS vfscommonupdate]}}
@form -synopsis "make.tcl vfscommonupdate ?-dirty-abort? ?-confirm 0|1?"
@opts
${$OPT_DIRTYABORT}
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::info"
@cmd -name "make.tcl info" -&
-summary "${[dict get $SUMMARIES info]}" -&
-help -&
{${[dict get $HELPTEXTS info]}}
@form -synopsis "make.tcl info ?-confirm 0|1?"
@opts
${$OPT_CONFIRM}
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::check"
@cmd -name "make.tcl check" -&
-summary "${[dict get $SUMMARIES check]}" -&
-help -&
{${[dict get $HELPTEXTS check]}}
@form -synopsis "make.tcl check"
@opts
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::projectversion"
@cmd -name "make.tcl projectversion" -&
-summary "${[dict get $SUMMARIES projectversion]}" -&
-help -&
{${[dict get $HELPTEXTS projectversion]}}
@form -synopsis "make.tcl projectversion"
@opts
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::workflow"
@cmd -name "make.tcl workflow" -&
-summary "${[dict get $SUMMARIES workflow]}" -&
-help -&
{${[dict get $HELPTEXTS workflow]}}
@form -synopsis "make.tcl workflow"
@opts
@values -min 0 -max 0
}
punk::args::define {
@id -id "(script)::punkboot::shell"
@ -3465,15 +3592,18 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
arg -type any -optional 1 -multiple 1 -help -&
"Arguments passed through to the punk repl."
}
punk::args::define\
"@id -id (script)::punkboot::buildsuite"\
"@normalize"\
"@cmd -name [list "make.tcl buildsuite"] -summary [list [dict get $SUMMARIES buildsuite]] -help [list [dict get $HELPTEXTS buildsuite]]"\
{@form -synopsis "make.tcl buildsuite list|info|build ?<suitename>? ?driver-args ...?"}\
{@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help\
punk::args::define {
@id -id "(script)::punkboot::buildsuite"
@cmd -name "make.tcl buildsuite" -&
-summary "${[dict get $SUMMARIES buildsuite]}" -&
-help -&
{${[dict get $HELPTEXTS buildsuite]}}
@form -synopsis "make.tcl buildsuite list|info|build ?<suitename>? ?driver-args ...?"
@values -min 0 -max -1
arg -type any -optional 1 -multiple 1 -help -&
"Action (list|info|build), suite name, and - for build - driver
arguments forwarded to the suite's suite.tcl untouched."}
arguments forwarded to the suite's suite.tcl untouched."
}
punk::args::define {
@id -id "(script)::punkboot::tool"
@ -3488,16 +3618,18 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
the -test 0|1 gate flag. Parsed by the handler."
}
punk::args::define\
"@id -id (script)::punkboot::help"\
"@normalize"\
"@cmd -name [list "make.tcl help"] -summary [list [dict get $SUMMARIES help]] -help [list\
"
Show tabled usage for make.tcl as a whole, or for a single subcommand.
Equivalent to 'make.tcl <subcommand> -help'."]"\
{@form -synopsis "make.tcl help ?subcommand?"}\
"@values -min 1 -max 1"\
"subject -type string -optional 0 -choices [list [dict keys $SUMMARIES]] -help {Subcommand to show usage for.}"
punk::args::define {
@id -id "(script)::punkboot::help"
@cmd -name "make.tcl help" -&
-summary "${[dict get $SUMMARIES help]}" -&
-help -&
{${[dict get $HELPTEXTS help]}}
@form -synopsis "make.tcl help ?subcommand?"
@values -min 1 -max 1
subject -type string -optional 0 -&
-choices {${[dict keys $SUMMARIES]}} -&
-help "Subcommand to show usage for."
}
#top-level definition: the subcommand table rendered by 'make.tcl' / 'make.tcl -help'
variable SUBGROUPS {
"build & bake" {bakehouse packages modules libs bake vfslibs bin}
@ -3508,34 +3640,43 @@ if {[info exists ::env(PUNKBOOT_PLAIN)] && [string is true -strict $::env(PUNKBO
"informational" {info check bakelist projectversion workflow help}
"interactive" {shell}
}
punk::args::define\
"@id -id (script)::punkboot"\
"@normalize"\
"@cmd -name make.tcl -summary {punkshell project build tool (punk boot)} -help [list\
"
punk boot: make any tclkits and modules in <projectdir>/src folders and place
them and associated data files/scripts in the parent folder of src - e.g in
'bin' and 'modules' folders at the same level as 'src'.
General usage: make.tcl <subcommand> ?flags?
'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' shows a
subcommand's own usage. Interactive y/n confirmations can be driven
non-interactively with the -confirm flag declared on the relevant
subcommands."]"\
{@form -synopsis "make.tcl ?subcommand? ?flags?"}\
"@leaders -min 1 -max 1"\
"subcommand -type string -optional 0 -choicecolumns 1 -choicegroups [list $SUBGROUPS] -choicelabels [list $SUMMARIES] -help\
{Use 'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' for details of a subcommand.}"
#top-level @cmd -help body (make.tcl itself is not a subcommand key, so this
#lives beside HELPTEXTS rather than in it) - same block-form/indentation
#convention as the HELPTEXTS entries
variable TOPLEVEL_HELP {
punk boot: make any tclkits and modules in <projectdir>/src folders and place
them and associated data files/scripts in the parent folder of src - e.g in
'bin' and 'modules' folders at the same level as 'src'.
General usage: make.tcl <subcommand> ?flags?
'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' shows a
subcommand's own usage. Interactive y/n confirmations can be driven
non-interactively with the -confirm flag declared on the relevant
subcommands.}
punk::args::define {
@id -id "(script)::punkboot"
@cmd -name "make.tcl" -&
-summary "punkshell project build tool (punk boot)" -&
-help -&
{${$TOPLEVEL_HELP}}
@form -synopsis "make.tcl ?subcommand? ?flags?"
@leaders -min 1 -max 1
subcommand -type string -optional 0 -choicecolumns 1 -&
-choicegroups {${$SUBGROUPS}} -&
-choicelabels {${$SUMMARIES}} -&
-help "Use 'make.tcl help <subcommand>' or 'make.tcl <subcommand> -help' for details of a subcommand."
}
#capability probe: force resolution of representative definitions now, inside
#the guarded block - a stale punk::args that accepted the raw text but cannot
#resolve a mechanism used here (e.g pre-@normalize snapshots) degrades to the
#plain fallback immediately instead of erroring at first parse/usage.
#resolve a mechanism used here (e.g snapshots predating -& record continuation
#or the G-046 display-field deferral) degrades to the plain fallback
#immediately instead of erroring at first parse/usage.
punk::args::get_spec (script)::punkboot
punk::args::get_spec (script)::punkboot::bakehouse
punk::args::get_spec (script)::punkboot::bake ;#exercises the G-121 kitname values spec (-choicerestricted mechanism)
punk::args::get_spec (script)::punkboot::help
punk::args::get_spec (script)::punkboot::shell
unset -nocomplain sub optvars defparts ov vp _mapmodel _rec _kitname_choicepart
unset -nocomplain _mapmodel _rec _g
}
} _defserr]} {
set ::punkboot::punkargs_ok 1

Loading…
Cancel
Save