From: Kevin Day Date: Sun, 17 Jul 2022 15:28:46 +0000 (-0500) Subject: Feature: The fake program should support the "top" parameter. X-Git-Tag: 0.6.0~47 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=4da4448ba72169ebb1823366359e06e49ff97251;p=fll Feature: The fake program should support the "top" parameter. The "top" is already available but it is not exposed through IKI variable parameter replacement. Update the documentation, including adding missing documentation about "return". Remove unused "return:option" and "return:value" parameter (this is not used because it is not valid). --- diff --git a/level_3/fake/c/private-common.c b/level_3/fake/c/private-common.c index bfc5b3d..012b53b 100644 --- a/level_3/fake/c/private-common.c +++ b/level_3/fake/c/private-common.c @@ -259,6 +259,7 @@ extern "C" { const f_string_static_t fake_make_parameter_variable_return_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_return_s, 0, FAKE_make_parameter_variable_return_s_length); const f_string_static_t fake_make_parameter_variable_settings_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_settings_s, 0, FAKE_make_parameter_variable_settings_s_length); const f_string_static_t fake_make_parameter_variable_sources_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_sources_s, 0, FAKE_make_parameter_variable_sources_s_length); + const f_string_static_t fake_make_parameter_variable_top_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_top_s, 0, FAKE_make_parameter_variable_top_s_length); const f_string_static_t fake_make_parameter_variable_verbosity_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_verbosity_s, 0, FAKE_make_parameter_variable_verbosity_s_length); const f_string_static_t fake_make_parameter_variable_work_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_work_s, 0, FAKE_make_parameter_variable_work_s_length); @@ -269,7 +270,6 @@ extern "C" { const f_string_static_t fake_make_parameter_variable_option_fakefile_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_fakefile_s, 0, FAKE_make_parameter_variable_option_fakefile_s_length); const f_string_static_t fake_make_parameter_variable_option_mode_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_mode_s, 0, FAKE_make_parameter_variable_option_mode_s_length); const f_string_static_t fake_make_parameter_variable_option_process_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_process_s, 0, FAKE_make_parameter_variable_option_process_s_length); - const f_string_static_t fake_make_parameter_variable_option_return_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_return_s, 0, FAKE_make_parameter_variable_option_return_s_length); const f_string_static_t fake_make_parameter_variable_option_settings_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_settings_s, 0, FAKE_make_parameter_variable_option_settings_s_length); const f_string_static_t fake_make_parameter_variable_option_sources_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_sources_s, 0, FAKE_make_parameter_variable_option_sources_s_length); const f_string_static_t fake_make_parameter_variable_option_verbosity_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_option_verbosity_s, 0, FAKE_make_parameter_variable_option_verbosity_s_length); @@ -282,7 +282,6 @@ extern "C" { const f_string_static_t fake_make_parameter_variable_value_fakefile_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_fakefile_s, 0, FAKE_make_parameter_variable_value_fakefile_s_length); const f_string_static_t fake_make_parameter_variable_value_mode_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_mode_s, 0, FAKE_make_parameter_variable_value_mode_s_length); const f_string_static_t fake_make_parameter_variable_value_process_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_process_s, 0, FAKE_make_parameter_variable_value_process_s_length); - const f_string_static_t fake_make_parameter_variable_value_return_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_return_s, 0, FAKE_make_parameter_variable_value_return_s_length); const f_string_static_t fake_make_parameter_variable_value_settings_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_settings_s, 0, FAKE_make_parameter_variable_value_settings_s_length); const f_string_static_t fake_make_parameter_variable_value_sources_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_sources_s, 0, FAKE_make_parameter_variable_value_sources_s_length); const f_string_static_t fake_make_parameter_variable_value_verbosity_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_value_verbosity_s, 0, FAKE_make_parameter_variable_value_verbosity_s_length); diff --git a/level_3/fake/c/private-common.h b/level_3/fake/c/private-common.h index 93a314d..446b605 100644 --- a/level_3/fake/c/private-common.h +++ b/level_3/fake/c/private-common.h @@ -1480,6 +1480,7 @@ extern "C" { #define FAKE_make_parameter_variable_return_s "return" #define FAKE_make_parameter_variable_settings_s "settings" #define FAKE_make_parameter_variable_sources_s "sources" + #define FAKE_make_parameter_variable_top_s "top" #define FAKE_make_parameter_variable_verbosity_s "verbosity" #define FAKE_make_parameter_variable_work_s "work" @@ -1490,7 +1491,6 @@ extern "C" { #define FAKE_make_parameter_variable_option_fakefile_s FAKE_make_parameter_variable_fakefile_s FAKE_make_parameter_iki_option_s #define FAKE_make_parameter_variable_option_mode_s FAKE_make_parameter_variable_mode_s FAKE_make_parameter_iki_option_s #define FAKE_make_parameter_variable_option_process_s FAKE_make_parameter_variable_process_s FAKE_make_parameter_iki_option_s - #define FAKE_make_parameter_variable_option_return_s FAKE_make_parameter_variable_return_s FAKE_make_parameter_iki_option_s #define FAKE_make_parameter_variable_option_settings_s FAKE_make_parameter_variable_settings_s FAKE_make_parameter_iki_option_s #define FAKE_make_parameter_variable_option_sources_s FAKE_make_parameter_variable_sources_s FAKE_make_parameter_iki_option_s #define FAKE_make_parameter_variable_option_verbosity_s FAKE_make_parameter_variable_verbosity_s FAKE_make_parameter_iki_option_s @@ -1503,7 +1503,6 @@ extern "C" { #define FAKE_make_parameter_variable_value_fakefile_s FAKE_make_parameter_variable_fakefile_s FAKE_make_parameter_iki_value_s #define FAKE_make_parameter_variable_value_mode_s FAKE_make_parameter_variable_mode_s FAKE_make_parameter_iki_value_s #define FAKE_make_parameter_variable_value_process_s FAKE_make_parameter_variable_process_s FAKE_make_parameter_iki_value_s - #define FAKE_make_parameter_variable_value_return_s FAKE_make_parameter_variable_return_s FAKE_make_parameter_iki_value_s #define FAKE_make_parameter_variable_value_settings_s FAKE_make_parameter_variable_settings_s FAKE_make_parameter_iki_value_s #define FAKE_make_parameter_variable_value_sources_s FAKE_make_parameter_variable_sources_s FAKE_make_parameter_iki_value_s #define FAKE_make_parameter_variable_value_verbosity_s FAKE_make_parameter_variable_verbosity_s FAKE_make_parameter_iki_value_s @@ -1522,6 +1521,7 @@ extern "C" { #define FAKE_make_parameter_variable_return_s_length 6 #define FAKE_make_parameter_variable_settings_s_length 8 #define FAKE_make_parameter_variable_sources_s_length 7 + #define FAKE_make_parameter_variable_top_s_length 3 #define FAKE_make_parameter_variable_verbosity_s_length 9 #define FAKE_make_parameter_variable_work_s_length 4 @@ -1532,7 +1532,6 @@ extern "C" { #define FAKE_make_parameter_variable_option_fakefile_s_length FAKE_make_parameter_variable_fakefile_s_length + FAKE_make_parameter_iki_option_s_length #define FAKE_make_parameter_variable_option_mode_s_length FAKE_make_parameter_variable_mode_s_length + FAKE_make_parameter_iki_option_s_length #define FAKE_make_parameter_variable_option_process_s_length FAKE_make_parameter_variable_process_s_length + FAKE_make_parameter_iki_option_s_length - #define FAKE_make_parameter_variable_option_return_s_length FAKE_make_parameter_variable_return_s_length + FAKE_make_parameter_iki_option_s_length #define FAKE_make_parameter_variable_option_settings_s_length FAKE_make_parameter_variable_settings_s_length + FAKE_make_parameter_iki_option_s_length #define FAKE_make_parameter_variable_option_sources_s_length FAKE_make_parameter_variable_sources_s_length + FAKE_make_parameter_iki_option_s_length #define FAKE_make_parameter_variable_option_verbosity_s_length FAKE_make_parameter_variable_verbosity_s_length + FAKE_make_parameter_iki_option_s_length @@ -1545,7 +1544,6 @@ extern "C" { #define FAKE_make_parameter_variable_value_fakefile_s_length FAKE_make_parameter_variable_fakefile_s_length + FAKE_make_parameter_iki_value_s_length #define FAKE_make_parameter_variable_value_mode_s_length FAKE_make_parameter_variable_mode_s_length + FAKE_make_parameter_iki_value_s_length #define FAKE_make_parameter_variable_value_process_s_length FAKE_make_parameter_variable_process_s_length + FAKE_make_parameter_iki_value_s_length - #define FAKE_make_parameter_variable_value_return_s_length FAKE_make_parameter_variable_return_s_length + FAKE_make_parameter_iki_value_s_length #define FAKE_make_parameter_variable_value_settings_s_length FAKE_make_parameter_variable_settings_s_length + FAKE_make_parameter_iki_value_s_length #define FAKE_make_parameter_variable_value_sources_s_length FAKE_make_parameter_variable_sources_s_length + FAKE_make_parameter_iki_value_s_length #define FAKE_make_parameter_variable_value_verbosity_s_length FAKE_make_parameter_variable_verbosity_s_length + FAKE_make_parameter_iki_value_s_length @@ -1564,6 +1562,7 @@ extern "C" { extern const f_string_static_t fake_make_parameter_variable_return_s; extern const f_string_static_t fake_make_parameter_variable_settings_s; extern const f_string_static_t fake_make_parameter_variable_sources_s; + extern const f_string_static_t fake_make_parameter_variable_top_s; extern const f_string_static_t fake_make_parameter_variable_verbosity_s; extern const f_string_static_t fake_make_parameter_variable_work_s; @@ -1574,7 +1573,6 @@ extern "C" { extern const f_string_static_t fake_make_parameter_variable_option_fakefile_s; extern const f_string_static_t fake_make_parameter_variable_option_mode_s; extern const f_string_static_t fake_make_parameter_variable_option_process_s; - extern const f_string_static_t fake_make_parameter_variable_option_return_s; extern const f_string_static_t fake_make_parameter_variable_option_settings_s; extern const f_string_static_t fake_make_parameter_variable_option_sources_s; extern const f_string_static_t fake_make_parameter_variable_option_verbosity_s; @@ -1587,7 +1585,6 @@ extern "C" { extern const f_string_static_t fake_make_parameter_variable_value_fakefile_s; extern const f_string_static_t fake_make_parameter_variable_value_mode_s; extern const f_string_static_t fake_make_parameter_variable_value_process_s; - extern const f_string_static_t fake_make_parameter_variable_value_return_s; extern const f_string_static_t fake_make_parameter_variable_value_settings_s; extern const f_string_static_t fake_make_parameter_variable_value_sources_s; extern const f_string_static_t fake_make_parameter_variable_value_verbosity_s; diff --git a/level_3/fake/c/private-make-operate.c b/level_3/fake/c/private-make-operate.c index 08abb01..edbbf99 100644 --- a/level_3/fake/c/private-make-operate.c +++ b/level_3/fake/c/private-make-operate.c @@ -364,6 +364,21 @@ extern "C" { unmatched = F_false; } + else if (fl_string_dynamic_partial_compare_string(fake_make_parameter_variable_top_s.string, data_make->buffer, fake_make_parameter_variable_top_s.used, iki_data->content.array[j]) == F_equal_to) { + data_make->cache_arguments.array[data_make->cache_arguments.used].used = 0; + + if (data_make->path.stack.used) { + *status = f_string_dynamic_append(data_make->path.stack.array[0], &data_make->cache_arguments.array[data_make->cache_arguments.used]); + + if (F_status_is_error(*status)) { + fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamic_append", F_true); + + break; + } + } + + unmatched = F_false; + } else { for (k = 0; k < 33; ++k) { diff --git a/level_3/fake/documents/fakefile.txt b/level_3/fake/documents/fakefile.txt index df94521..7096a8f 100644 --- a/level_3/fake/documents/fakefile.txt +++ b/level_3/fake/documents/fakefile.txt @@ -318,8 +318,10 @@ Fakefile Documentation: - fakefile: Associated with -f/--fakefile parameter. - mode: Associated with -m/--mode parameter and possibly with the build settings default mode "modes_default". - process: Associated with -p/--process parameter. + - return: Contains the return value of a previous operation that produces a return code. - settings: Associated with -s/--settings parameter. - sources: Associated with -S/--sources parameter. + - top: The absolute path to the "top" directory, which is the base project directory. - verbosity: Associated with +Q/++quiet, +E/++error, +N/++normal, +V/++verbose, and +D/++debug parameters. - work: Associated with -w/--work parameter. diff --git a/level_3/fake/specifications/fakefile.txt b/level_3/fake/specifications/fakefile.txt index 40d06ae..9a75a19 100644 --- a/level_3/fake/specifications/fakefile.txt +++ b/level_3/fake/specifications/fakefile.txt @@ -116,5 +116,5 @@ Fakefile Specification: - <= The "if" Section Operation condition "parameter"\: - The following reserved words are available for parameter names: build, color, data, define, fakefile, mode, process, settings, sources, verbosity, and work. + The following reserved words are available for parameter names: build, color, data, define, fakefile, mode, process, return, settings, sources, top, verbosity, and work. Each of the reserved words supports having ":option" and ":value" appended, such as: "work:value".