(zilch lang ninja): document

Change-Id: I6a6a6964dcc713504ec57f40981a601696a573af
This commit is contained in:
puck 2025-07-03 18:57:48 +00:00
parent 154ba9be1c
commit 93a1ebba00
11 changed files with 329 additions and 43 deletions

View file

@ -5,35 +5,13 @@
(foreign-lambda* int ()
"cpu_set_t set; sched_getaffinity(0, sizeof(set), &set); C_return(CPU_COUNT(&set));"))
(foreign-declare "#include \"man_ninja.h\"")
(define man-page (foreign-value "man_ninja" nonnull-c-string))
(define (print-help msg)
(when msg
(write-string (string-append msg "\n\n") (current-error-port)))
(write-string "Usage: zilch-cli-ninja [OPTION] SUBCOMMAND ...
Processes a Ninja build based on the configuration in the passed-in
config file (or zilch.scm, if not set), and reproducibly builds either
to final build, or to specific Ninja targets.
Supported commands:
build [TARGET] Build the full drv, or specific targets from
its Ninja file.
source [DIR] Extract the source of the derivation to DIR
(or src, if unspecified), ready for Zilch.
diff Print the difference between the original and
modified sources as found in either `src' or
the directory selected by --source.
Arguments:
-h, --help Print this help message.
-f, --config-file PATH Path to the Zilch config file.
-s, --source DIR Override the input source for builds. Doesn't
reconfigure the build, so changes to the
build system will not apply.
-j, --max-jobs COUNT The maximum amount of builds to run. Defaults
to the amount of cores.
-v, --verbose Increase the verbosity configured in the Nix
daemon.
-L, --print-build-logs Print derivation logs as they come in.
" (current-error-port))
(write-string man-page (current-error-port))
(exit (or (not msg) 1)))
(define-values (options args)