From 98d4f73134ac90ab12d023affa829ebd2937e592 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sun, 14 Apr 2024 17:09:49 +0630 Subject: asm/main now prints usage --- asm/main.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'asm/main.cpp') diff --git a/asm/main.cpp b/asm/main.cpp index 1ad17b1..17023e7 100644 --- a/asm/main.cpp +++ b/asm/main.cpp @@ -10,10 +10,24 @@ * Description: Entrypoint for assembly program */ +#include #include -int main(void) +#include + +#include "./lexer.hpp" + +void usage(const char *program_name, FILE *fp) +{ + fprintf(fp, + "Usage: %s FILE OUT-FILE\n" + "\tFILE: Source code to compile\n" + "\tOUT-FILE: Name of file to store bytecode\n", + program_name); +} + +int main(int argc, const char *argv[]) { - std::cout << "Hello, world!" << std::endl; + usage(argv[1], stdout); return 0; } -- cgit v1.2.3-13-gbd6f