From 4636eeb4bf93b260e5c5cbecfb18c8c9b2a6976d Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 17 May 2025 16:31:37 -0400 Subject: Add --version flag for executables and more documentation. --- src/compile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/compile.c') 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", ", ", -- cgit v1.2.3