From c035571d85e3d756804519d82de8b354f3910b29 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 8 Feb 2024 21:19:38 +0200 Subject: project work phase 1 --- src/main.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/main.c (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..a40d841 --- /dev/null +++ b/src/main.c @@ -0,0 +1,28 @@ +#include +#include + +static void usage(FILE *f, const char *pname) +{ + fprintf(f, "Usage:\n %s \n", pname); +} + +/** + * Main entry to posthaste. + * Checks command line and drives the rest of the language. + * + * Feels kind of weird documenting main, but doxygen warns about not + * doing it so whatever. + * + * @param argc Number of command line arguments. + * @param argv Array of command line arguments. + * @return \c 0 when succesful, non-zero otherwise. + */ +int main(int argc, char *argv[]) +{ + if (argc != 2) { + usage(stderr, argv[0]); + return -1; + } + + return run(argv[1]); +} -- cgit v1.2.3