This is the compliment to the "top" variable parameter.
The current working directory, also known as the present working directory, should be an IKI variable.
Use the f_string_dynamic_append_assure() rather than f_string_dynamic_append() to only add the trailing slash if it is not already present.
Update the documentation.
const f_string_static_t fake_make_parameter_variable_build_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_build_s, 0, FAKE_make_parameter_variable_build_s_length);
const f_string_static_t fake_make_parameter_variable_color_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_color_s, 0, FAKE_make_parameter_variable_color_s_length);
+ const f_string_static_t fake_make_parameter_variable_current_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_current_s, 0, FAKE_make_parameter_variable_current_s_length);
const f_string_static_t fake_make_parameter_variable_data_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_data_s, 0, FAKE_make_parameter_variable_data_s_length);
const f_string_static_t fake_make_parameter_variable_define_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_define_s, 0, FAKE_make_parameter_variable_define_s_length);
const f_string_static_t fake_make_parameter_variable_fakefile_s = macro_f_string_static_t_initialize(FAKE_make_parameter_variable_fakefile_s, 0, FAKE_make_parameter_variable_fakefile_s_length);
#define FAKE_make_parameter_variable_build_s "build"
#define FAKE_make_parameter_variable_color_s "color"
+ #define FAKE_make_parameter_variable_current_s "current"
#define FAKE_make_parameter_variable_data_s "data"
#define FAKE_make_parameter_variable_define_s "define"
#define FAKE_make_parameter_variable_fakefile_s "fakefile"
#define FAKE_make_parameter_variable_build_s_length 5
#define FAKE_make_parameter_variable_color_s_length 5
+ #define FAKE_make_parameter_variable_current_s_length 7
#define FAKE_make_parameter_variable_data_s_length 4
#define FAKE_make_parameter_variable_define_s_length 6
#define FAKE_make_parameter_variable_fakefile_s_length 8
extern const f_string_static_t fake_make_parameter_variable_build_s;
extern const f_string_static_t fake_make_parameter_variable_color_s;
+ extern const f_string_static_t fake_make_parameter_variable_current_s;
extern const f_string_static_t fake_make_parameter_variable_data_s;
extern const f_string_static_t fake_make_parameter_variable_define_s;
extern const f_string_static_t fake_make_parameter_variable_fakefile_s;
}
// For safe path handling, always append the trailing slash.
- *status = f_string_dynamic_append(f_path_separator_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]);
+ *status = f_string_dynamic_append_assure(f_path_separator_s, &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_assure", F_true);
+
+ break;
+ }
+ }
+
+ unmatched = F_false;
+ }
+ else if (fl_string_dynamic_partial_compare_string(fake_make_parameter_variable_current_s.string, data_make->buffer, fake_make_parameter_variable_current_s.used, iki_data->content.array[j]) == F_equal_to) {
+
+ if (data_make->path.stack.used) {
+ *status = f_string_dynamic_increase_by(data_make->path.stack.array[data_make->path.stack.used - 1].used + f_path_separator_s.used + 1, &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_increase_by", F_true);
+
+ break;
+ }
+
+ *status = f_string_dynamic_append(data_make->path.stack.array[data_make->path.stack.used - 1], &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;
}
+
+ // For safe path handling, always append the trailing slash.
+ *status = f_string_dynamic_append_assure(f_path_separator_s, &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_assure", F_true);
+
+ break;
+ }
}
unmatched = F_false;
The following are reserved parameters:
- build: Associated with -b/--build parameter.
- color: Associated with +d/++dark, +l/++light, and +n/++no_color parameters.
+ - current: The absolute path to the current working directory (present working directory) (Always has a trailing forward slash).
- data: Associated with -D/--data parameter.
- define: Associated with -d/--define parameter.
- fakefile: Associated with -f/--fakefile parameter.
- <=
The "if" Section Operation condition "parameter"\:
- The following reserved words are available for parameter names: build, color, data, define, fakefile, mode, process, return, settings, sources, top, verbosity, and work.
+ The following reserved words are available for parameter names: build, color, current, 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".