diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-23 14:54:12 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-23 14:54:12 +0000 |
| commit | 8d0ea93a7220730ccce754429549fd63e4eeaa7c (patch) | |
| tree | 8af868229559a54829991a20b7641d6c608a108d /src/main.c | |
| parent | f73df8d5de30a7f3f320fccf5f57c13094940a6a (diff) | |
Default arguments
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 |
