diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-05-19 23:33:34 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-05-19 23:33:34 +0300 |
| commit | 08788af6d50bf3f8a6b69b88a144597c3a997e8b (patch) | |
| tree | e60e8b2f2619d6b7d01f61cd20ac7867d478c62e /src/main.c | |
| parent | b38b84176337b3cbe66c8e0bea87c2fd5335677e (diff) | |
| download | ek-08788af6d50bf3f8a6b69b88a144597c3a997e8b.tar.gz ek-08788af6d50bf3f8a6b69b88a144597c3a997e8b.zip | |
document main
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -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; |
