Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works
Anything · Lazarus or Delphi
Random projectRandom project

fpnu

View on GitHub

Member rating

No ratings yet.

Sign in to rate this project.

README

fpnu

fpnu is an independent Free Pascal utility suite. This first Coreutils family implements echo, true, false, pwd, cat, and wc, with GNU Coreutils 9.11 as its initial behavior reference.

Build and run

Requirements are Free Pascal 3.2.2 or later and Python 3. Python is used for build-time registry generation and tests; the resulting utilities need no external runtime packages.

bash
make
build/bin/fpnu --help
build/bin/fpnu wc -l README.md
build/bin/cat README.md

make test builds both the multicall launcher and one executable per command, then checks their behavior against the host GNU Coreutils commands. All compiler output, generated Pascal sources, and executables stay under build/.

By default, fpnu diagnostics include a help hint. Set GNULY_CORRECT=1 for GNU-style diagnostic wording. Help and version output identify fpnu and the Coreutils 9.11 compatibility baseline.

Layout

  • src/runtime/ contains the command context, byte-safe standard streams, diagnostics, and multicall dispatcher.
  • src/commands/ contains one implementation unit per utility.
  • commands/*.tsv declares command names, implementation units, usage lines, and help descriptions for each utility family.
  • tools/generate_registry.py validates the manifests and generates the static command registry, launcher entry point, and direct executable entry points. The standalone entries link only their own command unit and the runtime; the multicall launcher links the generated registry.
  • tests/ contains the shared GNU comparison harness and family tests. The test runner discovers tests/families/*.py suites, each exposing run_suite(harness), so a new family can add its own grouped command checks.

To add a command, implement function Run(const Context: TCommandContext): Integer in its own Pascal unit and add its metadata to the matching family manifest. The generator rejects repeated names, repeated units, and missing or malformed implementations before the binaries are built.