Skip to content

Command Line Usage

Michael Wang edited this page Feb 9, 2022 · 8 revisions

The CLI interface is fairly simple to use. Most functionality comprises of command line arguments. Command line arguments in supperforth are parsed from left to right. The first expected flag is a functionality flag, followed by several operand flags depending on the functionality flag, and so forth(you can perform more than one operation in a single command):

./superforth [functionality flag] -s [source file] -o [output file]
./superforth [functionality flag] -s [source file]
./superforth [functionality flag]

See more on functionality flags to check whether a source or output is expected.

Functionality Flags

There are four principle functionality flags.

Functionality Flag Expects Source Expects Output
Information/Help -info N/A N/A
Compile -c Expects SuperForth Source Expects Binary Output Destination
Run -r Expects Binary N/A
Compile and Run -cr Expects SuperForth Source N/A
Inspect Dump (from superforth binary) -rd Expects Binary N/A
Inspect Dump (after compiling source) -cd Expects SuperForth Source N/A

Argument/Specifier Flags

To specify an source, use the -s flag followed by a source specifier(ie filepath). To specify an output, use the -o flag followed by an output specifier(ie filepath). Note: that a source doesn't necessarily have to be a SuperForth source or a SuperForth binary. Note: Usually the source specifier is required before the output specifier.

Clone this wiki locally