fll_program_print_help_option(data.context, fss_basic_read_short_at, fss_basic_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index.");
fll_program_print_help_option(data.context, fss_basic_read_short_depth, fss_basic_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth.");
+ fll_program_print_help_option(data.context, fss_basic_read_short_empty, fss_basic_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing.");
fll_program_print_help_option(data.context, fss_basic_read_short_line, fss_basic_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the content at the given line.");
fll_program_print_help_option(data.context, fss_basic_read_short_name, fss_basic_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name.");
fll_program_print_help_option(data.context, fss_basic_read_short_object, fss_basic_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content.");
#ifndef _di_fss_basic_read_defines_
#define fss_basic_read_short_at "a"
#define fss_basic_read_short_depth "d"
+ #define fss_basic_read_short_empty "e"
#define fss_basic_read_short_line "l"
#define fss_basic_read_short_name "n"
#define fss_basic_read_short_object "o"
#define fss_basic_read_long_at "at"
#define fss_basic_read_long_depth "depth"
+ #define fss_basic_read_long_empty "empty"
#define fss_basic_read_long_line "line"
#define fss_basic_read_long_name "name"
#define fss_basic_read_long_object "object"
fss_basic_read_parameter_at,
fss_basic_read_parameter_depth,
+ fss_basic_read_parameter_empty,
fss_basic_read_parameter_line,
fss_basic_read_parameter_name,
fss_basic_read_parameter_object,
f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, f_false, f_console_type_inverse), \
f_console_parameter_initialize(fss_basic_read_short_at, fss_basic_read_long_at, 0, f_true, f_console_type_normal), \
f_console_parameter_initialize(fss_basic_read_short_depth, fss_basic_read_long_depth, 0, f_true, f_console_type_normal), \
+ f_console_parameter_initialize(fss_basic_read_short_empty, fss_basic_read_long_empty, 0, f_false, f_console_type_normal), \
f_console_parameter_initialize(fss_basic_read_short_line, fss_basic_read_long_line, 0, f_true, f_console_type_normal), \
f_console_parameter_initialize(fss_basic_read_short_name, fss_basic_read_long_name, 0, f_true, f_console_type_normal), \
f_console_parameter_initialize(fss_basic_read_short_object, fss_basic_read_long_object, 0, f_false, f_console_type_normal), \
f_console_parameter_initialize(fss_basic_read_short_total, fss_basic_read_long_total, 0, f_false, f_console_type_normal), \
}
- #define fss_basic_read_total_parameters 12
+ #define fss_basic_read_total_parameters 13
#endif // _di_fss_basic_read_defines_
#ifndef _di_fss_basic_read_data_
memset(names, 1, sizeof(bool) * data->objects.used);
}
+ bool include_empty = 0;
+
+ if (data->parameters[fss_basic_read_parameter_empty].result == f_console_result_found) {
+ include_empty = 1;
+ }
+
if (data->parameters[fss_basic_read_parameter_object].result == f_console_result_found) {
if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) {
if (depths.array[0].index_at > 0) {
f_string_length total = 0;
for (f_string_length i = 0; i < data->objects.used; i++) {
- if (names[i] == 0 || data->contents.array[i].used == 0) continue;
+ if (!names[i]) {
+ continue;
+ }
+
+ if (data->contents.array[i].used == 0 && !include_empty) {
+ continue;
+ }
total++;
} // for
f_string_length line_current = 0;
for (f_string_length i = 0; i < data->contents.used; i++) {
- if (names[i] == 0 || data->contents.array[i].used == 0) continue;
+ if (!names[i]) {
+ continue;
+ }
+
+ if (data->contents.array[i].used == 0) {
+ if (include_empty) {
+ if (line_current == line) {
+ fprintf(f_standard_output, "%c", f_string_eol);
+ break;
+ }
+
+ line_current++;
+ }
+
+ continue;
+ }
if (line_current == line) {
f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[i].array[0]);
}
for (f_string_length i = 0; i < data->contents.used; i++) {
- if (!names[i] || data->contents.array[i].used == 0) continue;
+ if (!names[i]) {
+ continue;
+ }
+
+ if (data->contents.array[i].used == 0) {
+ if (include_empty) {
+ fprintf(f_standard_output, "%c", f_string_eol);
+ }
+
+ continue;
+ }
f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[i].array[0]);
fprintf(f_standard_output, "%c", f_string_eol);