Version 0.2.1 behavior is documented here. Thesupport record separates local verification frompublished MoonX behavior; moonx examples use registry releases.
Compare two files or directories, using - for stdin. Normal output identifiesinserted, deleted and changed lines; -u/-U selects unified output and-c/-C selects context output, with three context lines by default.
moonx cli/diff old.txt new.txt
moonx cli/diff -u --label old --label new old.txt new.txt
-q/--brief reports differences without a patch. -s/--report-identical-filesreports equal files. -a/--text treats NUL-containing inputs as text, preservingNUL and malformed UTF-8 bytes. Repeated --label options set the displayedleft and right names, including brief, identical and binary reports.
-i/--ignore-case compares ASCII letters without case. -w/--ignore-all-spaceignores C whitespace within each line; -b/--ignore-space-change collapseswhitespace runs and ignores trailing whitespace. -Z/--ignore-trailing-spaceignores trailing whitespace only. Those whitespace modes also ignore themissing final line-feed distinction. -B/--ignore-blank-lines suppresses achange group only when every changed line is blank under the selected comparisonrules; it does not remove blank lines before comparison. Unified/context hunkscontaining another substantive change retain the blank changes.
--strip-trailing-cr removes one CR immediately before each LF, includingdisplayed lines; a CR in an unterminated final line remains. Other comparisontransformations preserve the original displayed bytes. Input records are byteviews into the two buffered files. Comparison classes reuse those views whenpossible; only transformed keys allocate additional bytes. Rendering convertsdisplayed records to text without converting either complete input file.
Directory entries are processed in C byte order. Without -r/--recursive, commonsubdirectories are reported without descent. -N/--new-file compares missingsides as empty; --unidirectional-new-file does so only for a missing left side.A file paired with a directory selects the corresponding basename in thatdirectory. Recursive traversal uses public path resolution to detect ancestorloops. Directory/file type differences and directory FIFO/socket pairs arereported like the fixed GNU profile. Top-level readable special files arecompared as input streams. Directory character/block device pairs requiredevice-number metadata; the same resolved path is equal, while other pairsremain an explicit device-number capability boundary.Symlinks follow their public filesystem targets; comparing link-target textitself remains outside this profile.Path messages use C-locale shell escaping, while automatic unified/contextheader names use C quoting. Explicit --label text remains unchanged.
Exit status is 0 for identical files, 1 for a difference, and 2 for an inputor option error. Directory errors retain earlier output and do not hide errorsbehind later successful entries. Non-C locale collation is outside this release.Timestamp headers honor TZ, TZDIR,64-bit TZif transitions and explicit POSIX DST rules, including dates after2038. With no TZ, the host's /etc/localtime is used. Missing timezonedata is an error. Unified output uses ISO timestamps and context output uses thetraditional weekday/month/day format. Use --label for stdin or hosts withouta timezone database. --help and --version are available.Both files, record indexes, distinct comparison keys and patch output remainbuffered. Unchanged keys share input bytes. Edit reconstruction usesbidirectional Myers frontiers and an explicit partition stack with O(N+M)auxiliary space, excluding input/key bytes and the produced edit/output records.Records without a possible counterpart bypass the edit search. Equivalent-linechange alignment joins neighboring changes and exercises the registered GNUrepeated-line cases. This is neither constant-memory diff nor a linear-timeguarantee for high edit density.
Standalone --version prints exactly diff 0.2.1 followed by onenewline. Standalone --help starts with Usage: diff, 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.