summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-23 14:54:12 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-23 14:54:12 +0000
commit8d0ea93a7220730ccce754429549fd63e4eeaa7c (patch)
tree8af868229559a54829991a20b7641d6c608a108d /src/main.c
parentf73df8d5de30a7f3f320fccf5f57c13094940a6a (diff)
Default arguments
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 6fa8809..da1bec6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -37,6 +37,7 @@ void print_usage()
printf(" transpile Transpile to C code only (no compilation)\n");
printf(" lsp Start Language Server\n");
printf("Options:\n");
+ printf(" --help Print this help message\n");
printf(" --version Print version information\n");
printf(" -o <file> Output executable name\n");
printf(" --emit-c Keep generated C file (out.c)\n");
@@ -92,6 +93,11 @@ int main(int argc, char **argv)
{
// default mode
}
+ else if (strcmp(command, "--help") == 0 || strcmp(command, "-h") == 0)
+ {
+ print_usage();
+ return 0;
+ }
else if (command[0] == '-')
{
// implicit build or run? assume build if starts with flag, but usually