4.8 Dry-Run Mode Detection
The zuo/dry-run module is reprovided by zuo.
Added in version 1.8.
procedure
(maybe-dry-run-mode) → (or/c #f 'dry-run 'question)
Returns a non-#f value when a dry-run configuration is found via the
MAKEFLAGS environment variable, #f otherwise. That
environment variable is normally set by make when it runs a target
command and when -n, -q, or -t was provided.
Since “touch” mode is not supported by build, detection of a -t flag triggers an error instead of a non-#f value. Conflicting options also trigger an error.
The MAKEFLAGS environment variable is parsed into arguments using shell->strings. If the first argument has only ASCII letters (lowercase or uppercase), then it is treated as a set of single-character flags. Otherwise, the argument list is scanned for "-n", "--just-print", "--dry-run", "--recon", "-q", "--question", "-t", or "--touch" stopping at any "--".