Usage: gen-script [-registry SOURCE]... [-add-pubreg] [-shell bash|sh] [-static] [-strategy latest|favored|locked] ?package@version_range ...?

Write a standalone build script to stdout. The default shell is bash.
Resolve project dependencies and include their recipes and patches in build order.
With no package arguments, also include the project's build recipe.
Hooks run when the generated script is executed, not during generation.
Generation does not install packages, change project files, or send telemetry.
-registry appends a local directory or HTTP(S) API URL; repeat to set lookup order.
-add-pubreg appends the public default after explicit or saved sources
(synced local copy, otherwise API) without changing the saved configuration.

The script installs into build/install beside the script and needs no ttrek binary.
USE flags come from the current installation's ttrek-venv/ttrek-manifest.json.
A missing manifest or useFlags field means no configured flags.
-static enables +static for this script only, without changing the manifest.
Static Tcl extensions require registration by an embedding application.

Examples:
    ttrek gen-script > build.sh
    ttrek gen-script -registry ../ttrek.sh/registry > build.sh
    ttrek gen-script -shell sh -static jinja2-tcl > build.sh
    bash build.sh

The first registry containing a package supplies its versions and recipe.
Only an absent package advances to the next registry; other errors stop lookup.
Explicit sources replace the saved list and defaults for this invocation.
