Module args

Source
Expand description

A handwritten parser for our arguments.

We don’t currently use a 3rd party library like clap for a few reasons. Firstly, we need to support flags like --push-state and --pop-state. These need to push and pop a state stack when they’re parsed. Some of the other flags then need to manipulate the state of the top of the stack. Positional arguments like input files and libraries to link, then need to have the current state of the stack attached to that file.

Secondly, long arguments need to also be accepted with a single ‘-’ in addition to the more common double-dash.

Basically, we need to be able to parse arguments in the same way as the other linkers on the platform that we’re targeting.

Constants§

REFERENCE_LINKER_ENV
VALIDATE_ENV
WILD_UNSUPPORTED_ENV
WRITE_LAYOUT_ENV
WRITE_TRACE_ENV