This documents version 0.2.2. The support recordtracks platform verification and exact-version publication evidence separately.
Print the environment or execute one command with explicit environmentchanges. Supports -i/--ignore-environment and -u NAME/--unset=NAME.The common GNU path also accepts bare - as an empty-environment request,-0/--null for NUL-separated output, and -C/--chdir for the childworking directory. --null with a child command fails with status 125.Command execution uses MoonBit's policy-visible process API, never a shell;the command and every argument are passed as separate argv entries. Becauseexecution can create a child process, the caller or host may require processauthorization. The command itself does not implement an allowlist.
Option/assignment precedence, repeated unsets, --, command lookup, and exitstatuses 125 (command setup), 126 (not invokable), and 127 (not found) arecovered by the P2 profile. Non-empty assignment names are passed through evenwhen they are not shell identifiers, and the first assignment ends optionscanning. --help and --version return successful output.
Both backends start from the complete environment made available by the host,then apply the requested removals and assignments. LANG, LC_ALL, and othernames are neither filtered nor rewritten. Host authorization still applies tothe child working directory and executable.
Windows Native cannot currently launch a child whose final environment isempty: released async 0.22.5 does not initialize its empty Win32 environmentblock. This path rejects before launch with status 125 and an explicitunsupported-capability diagnostic. Empty environment enumeration without achild remains supported, as do launches with a nonempty final environment,Windows Wasm and POSIX. Lifting this restriction requires a released asyncfix and a real Windows Native empty-environment launch regression.
-S STRING / --split-string=STRING expands one string into argument wordsat the current option position. Single/double quotes, GNU split-string escapes,token-start comments, and ${NAME} expansion are supported; this is not shellevaluation. Expansions read the original inherited environment, includingwhen -i or -u will remove the variable from the child's environment. Wordsfrom later command-line arguments remain after the expanded words. Malformedquotes, escapes, or variable syntax fail with status 125 before launch.
Without a command, environment enumeration has no ordering guarantee. Thepublic process environment is a map, while GNU's order also varies with thehost C library. Use a command such as printenv A B when an ordered list ofspecific values is needed.
Standalone --version prints exactly env 0.2.2 followed by onenewline. Standalone --help starts with Usage: env, lists bothmetadata options, and ends with a newline. Both write to stdout, leave stdinunread, and exit with status 0. Exact-version publication and verificationremain recorded separately in the support record.