When someone rewrites a command line tool in another language, the hard question is not “does it pass its tests” but “does it still do what the old one did” in all the small corners nobody wrote a test for.

I built a small open source tool for that, behave (Go, MIT): https://github.com/emirmrkaljevic/behave . It reads a tool’s --help, generates a few hundred cases (every flag, a few values each, some stdin and file inputs), records stdout, stderr, exit code and touched files from the original binary, then replays the same cases against the rewrite and groups the diffs. The recording is plain YAML you can read and commit.

I pointed it at the Rust rewrites of GNU coreutils, findutils, sed and procps. So far that turned into 44 upstream bug reports and 51 fix PRs, 34 of them merged. The linked post is about the second rewrite (findutils and sed) and which kinds of differences kept showing up: error wording, exit codes and option parsing corners rather than crashes.

Happy to hear where this approach falls short.