Garter – cli

using the cli

simple compilation

The simplest way to tell garter to build something is to just pass it as an argument into the cli like

garter input.gy

If you'd like to specify an output file, you can also pass in that name

garter input.gy binary

By default, the cli will assume the first name it sees that it doesn't recognize as a commandline argument or input filename should be used as the output filename, but if you'd like to be explicit, you can use the -o output flag

garter -o binary input.gy

generated files

Between compilation and binary output, there will be *.gasm assembly and *.gyb bytecode produced. The default behavior of Garter is to remove these files after building, but if you'd like to keep them then just give them names. If you wanted the generated assembly and static bytecode files, for example,

garter -o binary input.gy assembly.gasm bytecode.gyb

commandline arguments

-h, --help
displays a help message

-v, --version
displays the version number

-r, --run
run the binary after building

-o
specifies the output filename

-s, --standard
selects the language standard

-t, --target
selects the emitter backend

-p, --pedantic
treat all warnings as errors. cannot be used with -w

-w
ignore all warnings. cannot be used with -p

We recommend setting the -p and -r flags when you first start using Garter to enable pedantic compilation and run after builds