diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-08-31 12:51:47 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-08-31 12:51:47 -0400 |
| commit | 07c5287760ca7a80c06dd80defe007ad009695fc (patch) | |
| tree | da8145974f100c7c8f96fbf73170d9991a1f75cf /src/tomo.c | |
| parent | c3bcb504a07823ec8a096d34d0f4fe8dc5b27196 (diff) | |
Add argument aliases so programs can use `func main(verbose|v=no)` to do
single-letter argument flags.
Diffstat (limited to 'src/tomo.c')
| -rw-r--r-- | src/tomo.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -289,7 +289,7 @@ int main(int argc, char *argv[]) { if (files.length < 1) print_err("No file specified!"); - quiet = !verbose; + if (!compile_exe && !stop_at_transpile && !stop_at_obj_compilation) quiet = !verbose; for (int64_t i = 0; i < files.length; i++) { Path_t path = *(Path_t *)(files.data + i * files.stride); @@ -404,7 +404,7 @@ void build_library(Path_t lib_dir) { int status = pclose(prog); if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) exit(EXIT_FAILURE); - if (!quiet) print("Compiled library:\t", shared_lib); + if (!quiet) print("Compiled library:\t", Path$relative_to(shared_lib, Path$current_dir())); } void install_library(Path_t lib_dir) { @@ -726,7 +726,7 @@ void transpile_header(env_t *base_env, Path_t path) { Text$print(header, h_code); if (fclose(header) == -1) print_err("Failed to write header file: ", h_filename); - if (!quiet) print("Transpiled header:\t", h_filename); + if (!quiet) print("Transpiled header:\t", Path$relative_to(h_filename, Path$current_dir())); if (show_codegen.length > 0) xsystem(show_codegen, " <", h_filename); } @@ -765,7 +765,7 @@ void transpile_code(env_t *base_env, Path_t path) { if (fclose(c_file) == -1) print_err("Failed to output C code to ", c_filename); - if (!quiet) print("Transpiled code:\t", c_filename); + if (!quiet) print("Transpiled code:\t", Path$relative_to(c_filename, Path$current_dir())); if (show_codegen.length > 0) xsystem(show_codegen, " <", c_filename); } @@ -781,7 +781,7 @@ void compile_object_file(Path_t path) { Path$write(build_file(path, ".config"), config_summary, 0644); - if (!quiet) print("Compiled object:\t", obj_file); + if (!quiet) print("Compiled object:\t", Path$relative_to(obj_file, Path$current_dir())); } Path_t compile_executable(env_t *base_env, Path_t path, Path_t exe_path, List_t object_files, List_t extra_ldlibs) { @@ -821,6 +821,6 @@ Path_t compile_executable(env_t *base_env, Path_t path, Path_t exe_path, List_t int status = pclose(runner); if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) exit(EXIT_FAILURE); - if (!quiet) print("Compiled executable:\t", exe_path); + if (!quiet) print("Compiled executable:\t", Path$relative_to(exe_path, Path$current_dir())); return exe_path; } |
