aboutsummaryrefslogtreecommitdiff
path: root/src/compile.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-05-17 16:31:37 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-05-17 16:31:37 -0400
commit4636eeb4bf93b260e5c5cbecfb18c8c9b2a6976d (patch)
tree64520e477f3b5d80354553a006a10565ff1546d0 /src/compile.c
parent13e7d04a74f7ad0b9b9dc96f681d091b65dce5ec (diff)
Add --version flag for executables and more documentation.
Diffstat (limited to 'src/compile.c')
-rw-r--r--src/compile.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compile.c b/src/compile.c
index 410ee364..cd6aef72 100644
--- a/src/compile.c
+++ b/src/compile.c
@@ -4015,7 +4015,7 @@ static CORD get_flag_options(type_t *t, CORD separator)
}
}
-CORD compile_cli_arg_call(env_t *env, CORD fn_name, type_t *fn_type)
+CORD compile_cli_arg_call(env_t *env, CORD fn_name, type_t *fn_type, const char *version)
{
DeclareMatch(fn_info, fn_type, FunctionType);
@@ -4084,7 +4084,8 @@ CORD compile_cli_arg_call(env_t *env, CORD fn_name, type_t *fn_type)
code = CORD_all(code, ";\n");
}
- code = CORD_all(code, "tomo_parse_args(argc, argv, ", usage_code, ", ", help_code);
+ CORD version_code = CORD_quoted(version);
+ code = CORD_all(code, "tomo_parse_args(argc, argv, ", usage_code, ", ", help_code, ", ", version_code);
for (arg_t *arg = fn_info->args; arg; arg = arg->next) {
code = CORD_all(code, ",\n{", CORD_quoted(CORD_replace(arg->name, "_", "-")), ", ",
(arg->default_val || arg->type->tag == OptionalType) ? "false" : "true", ", ",