aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 9077061..3faf5d5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -16,9 +16,14 @@
#include <ek/imports.h>
#include <ek/compiler.h>
+/**
+ * String describing compiler usage.
+ * @todo I suspect backends might want more flags, come up with
+ * some way to make flag handling more generic
+ */
static const char *cmdline_usage =
"ek compiler usage:\n"
- " cu [-I <dir>...] [-D <var>...] infile...\n"
+ " ek [-I <dir>...] [-D <var>...] infile...\n"
" -h Show usage (this)\n"
" -I <dir> Add directory to import path\n"
" -D <var> Add predefined variable\n"
@@ -26,11 +31,22 @@ static const char *cmdline_usage =
" infile Top file(s) to compile\n"
;
+/** Print usage of compiler. */
static void usage()
{
fprintf(stderr, cmdline_usage);
}
+/**
+ * Main entry to compiler.
+ * Checks command line parameters and drives the rest of the compiler.
+ * 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[])
{
int opt;