Skip to content

Command-line options: help, version, trace, limits, input file #39

Description

@paulhoadley

The CLI accepts exactly one optional argument (the object file) and defaults to ./CODE. Useful additions, all implementable with plain argument parsing and no dependency:

  • --help and --version (read from the jar manifest).
  • --trace: print each instruction as it executes, with the program counter and the top of the stack. The single most useful thing for a student debugging their compiler's output.
  • --code-size N and --data-size N to lift the 1,000 / 500 limits (needs the limits to be constructor parameters, Source-level tidy-up and Javadoc lint #36).
  • --input FILE as an alternative to stdin redirection (helps on Windows and inside IDEs).
  • Exit 2 for usage errors, distinct from the program's own failure status.

Effort: M. Priority: P3. From the September 2026 project review (T25).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions