The default behavior is already a -c/--content.
This provides a literal parameter for good practice and better hackability.
This introduces a new possibility where both -o/--object and -c/--content are specified at the same time.
In this case, print both the object and the content.
It must be noted, however, that this only prints the escaped object and content, just like when -o/--object or -c/--content do already.
The objects in the basic read and extended read are printed with a space between them and their respective content.
The objects in the basic list read and extended list read are printed with an EOL ('\n') between them and their respective content.
printf("%c", f_string_eol[0]);
fll_program_print_help_option(file, context, fss_basic_list_read_short_at, fss_basic_list_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_content, fss_basic_list_read_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the content (default).");
fll_program_print_help_option(file, context, fss_basic_list_read_short_depth, fss_basic_list_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth.");
fll_program_print_help_option(file, context, fss_basic_list_read_short_empty, fss_basic_list_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing.");
fll_program_print_help_option(file, context, fss_basic_list_read_short_line, fss_basic_list_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(file, context, fss_basic_list_read_short_name, fss_basic_list_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name.");
- fll_program_print_help_option(file, context, fss_basic_list_read_short_object, fss_basic_list_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_object, fss_basic_list_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object.");
fll_program_print_help_option(file, context, fss_basic_list_read_short_select, fss_basic_list_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index.");
fll_program_print_help_option(file, context, fss_basic_list_read_short_total, fss_basic_list_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines.");
fll_program_print_help_option(file, context, fss_basic_list_read_short_trim, fss_basic_list_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print.");
printf("%c", f_string_eol[0]);
+ printf(" When specifying both the ");
+ fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object);
+ printf(" parameter and the ");
+ fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_content);
+ printf(" parameter, the entire object and content are printed, including the formatting.%c", f_string_eol[0]);
+ printf(" Both the object and content printed are already escaped.%c", f_string_eol[0]);
+ printf(" Both the object and content are separated by an EOL.%c", f_string_eol[0]);
+
+ printf("%c", f_string_eol[0]);
+
return F_none;
}
#endif // _di_fss_basic_list_read_print_help_
fss_basic_list_read_delete_data(data);
return F_status_set_error(F_parameter);
}
+
+ if (data->parameters[fss_basic_list_read_parameter_content].result == f_console_result_found) {
+ if (data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) {
+ fl_color_print(data->error.to.stream, data->context.set.error, "%sCannot specify both the '", fll_error_print_error);
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' and the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_content);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_total);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+
+ fss_basic_list_read_delete_data(data);
+ return F_status_set_error(F_parameter);
+ }
+ }
}
if (data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_additional) {
#endif // _di_fss_basic_list_read_name_
#ifndef _di_fss_basic_list_read_defines_
- #define fss_basic_list_read_short_at "a"
- #define fss_basic_list_read_short_depth "d"
- #define fss_basic_list_read_short_empty "e"
- #define fss_basic_list_read_short_line "l"
- #define fss_basic_list_read_short_name "n"
- #define fss_basic_list_read_short_object "o"
- #define fss_basic_list_read_short_select "s"
- #define fss_basic_list_read_short_total "t"
- #define fss_basic_list_read_short_trim "T"
-
- #define fss_basic_list_read_long_at "at"
- #define fss_basic_list_read_long_depth "depth"
- #define fss_basic_list_read_long_empty "empty"
- #define fss_basic_list_read_long_line "line"
- #define fss_basic_list_read_long_name "name"
- #define fss_basic_list_read_long_object "object"
- #define fss_basic_list_read_long_select "select"
- #define fss_basic_list_read_long_total "total"
- #define fss_basic_list_read_long_trim "trim"
+ #define fss_basic_list_read_short_at "a"
+ #define fss_basic_list_read_short_content "c"
+ #define fss_basic_list_read_short_depth "d"
+ #define fss_basic_list_read_short_empty "e"
+ #define fss_basic_list_read_short_line "l"
+ #define fss_basic_list_read_short_name "n"
+ #define fss_basic_list_read_short_object "o"
+ #define fss_basic_list_read_short_select "s"
+ #define fss_basic_list_read_short_total "t"
+ #define fss_basic_list_read_short_trim "T"
+
+ #define fss_basic_list_read_long_at "at"
+ #define fss_basic_list_read_long_content "content"
+ #define fss_basic_list_read_long_depth "depth"
+ #define fss_basic_list_read_long_empty "empty"
+ #define fss_basic_list_read_long_line "line"
+ #define fss_basic_list_read_long_name "name"
+ #define fss_basic_list_read_long_object "object"
+ #define fss_basic_list_read_long_select "select"
+ #define fss_basic_list_read_long_total "total"
+ #define fss_basic_list_read_long_trim "trim"
enum {
fss_basic_list_read_parameter_help,
fss_basic_list_read_parameter_version,
fss_basic_list_read_parameter_at,
+ fss_basic_list_read_parameter_content,
fss_basic_list_read_parameter_depth,
fss_basic_list_read_parameter_empty,
fss_basic_list_read_parameter_line,
f_console_parameter_t_initialize(f_console_standard_short_debug, f_console_standard_long_debug, 0, 0, f_console_type_inverse), \
f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, 0, f_console_type_inverse), \
f_console_parameter_t_initialize(fss_basic_list_read_short_at, fss_basic_list_read_long_at, 0, 1, f_console_type_normal), \
+ f_console_parameter_t_initialize(fss_basic_list_read_short_content, fss_basic_list_read_long_content, 0, 0, f_console_type_normal), \
f_console_parameter_t_initialize(fss_basic_list_read_short_depth, fss_basic_list_read_long_depth, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_basic_list_read_short_empty, fss_basic_list_read_long_empty, 0, 0, f_console_type_normal), \
f_console_parameter_t_initialize(fss_basic_list_read_short_line, fss_basic_list_read_long_line, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_basic_list_read_short_trim, fss_basic_list_read_long_trim, 0, 0, f_console_type_normal), \
}
- #define fss_basic_list_read_total_parameters 18
+ #define fss_basic_list_read_total_parameters 19
#endif // _di_fss_basic_list_read_defines_
#ifndef _di_fss_basic_list_read_data_t_
}
}
- f_string_length_t select = 0;
+ f_number_unsigned_t select = 0;
if (data->parameters[fss_basic_list_read_parameter_select].result == f_console_result_additional) {
- const f_string_length_t index = data->parameters[fss_basic_list_read_parameter_select].additional.array[data->parameters[fss_basic_list_read_parameter_select].additional.used - 1];
+ const f_array_length_t index = data->parameters[fss_basic_list_read_parameter_select].additional.array[data->parameters[fss_basic_list_read_parameter_select].additional.used - 1];
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[index]));
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &select, range);
}
}
- f_string_length_t line = 0;
+ f_array_length_t line = 0;
if (data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_additional) {
- const f_string_length_t index = data->parameters[fss_basic_list_read_parameter_line].additional.array[data->parameters[fss_basic_list_read_parameter_line].additional.used - 1];
+ const f_array_length_t index = data->parameters[fss_basic_list_read_parameter_line].additional.array[data->parameters[fss_basic_list_read_parameter_line].additional.used - 1];
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[index]));
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &line, range);
bool names[data->objects.used];
+ f_array_length_t i = 0;
+ f_array_length_t j = 0;
+
if (depths.array[0].index_name > 0) {
memset(names, 0, sizeof(bool) * data->objects.used);
f_string_length_t name_length = 0;
if (data->parameters[fss_basic_list_read_parameter_trim].result == f_console_result_found) {
- for (f_string_length_t i = 0; i < data->objects.used; i++) {
+ for (i = 0; i < data->objects.used; i++) {
name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1;
} // for
}
else {
- for (f_string_length_t i = 0; i < data->objects.used; i++) {
+ for (i = 0; i < data->objects.used; i++) {
name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1;
if (name_length == depths.array[0].value_name.used) {
}
}
else if (depths.array[0].index_name > 0) {
- f_string_length_t total = 0;
+ f_array_length_t total = 0;
- for (f_string_length_t i = 0; i < data->objects.used; i++) {
+ for (i = 0; i < data->objects.used; i++) {
if (!names[i]) continue;
total++;
if (names[i]) {
if (at == depths.array[0].value_at) {
print_object(f_type_output, data->buffer, data->objects.array[i]);
- fprintf(f_type_output, "%c", f_string_eol[0]);
+
+ if (data->parameters[fss_basic_list_read_parameter_content].result == f_console_result_found) {
+ if (data->contents.array[i].used) {
+ fprintf(f_type_output, "%c", f_fss_eol);
+ f_print_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[0]);
+ }
+ else {
+ fprintf(f_type_output, "%c", f_fss_eol);
+ }
+ }
+
+ fprintf(f_type_output, "%c", f_fss_eol);
break;
}
return F_none;
}
- for (f_string_length_t i = 0; i < data->objects.used; i++) {
+ for (i = 0; i < data->objects.used; i++) {
if (!names[i]) continue;
print_object(f_type_output, data->buffer, data->objects.array[i]);
- fprintf(f_type_output, "%c", f_string_eol[0]);
+
+ if (data->parameters[fss_basic_list_read_parameter_content].result == f_console_result_found) {
+ if (data->contents.array[i].used) {
+ fprintf(f_type_output, "%c", f_fss_eol);
+ f_print_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[0]);
+ }
+ else {
+ fprintf(f_type_output, "%c", f_fss_eol);
+ }
+ }
+
+ fprintf(f_type_output, "%c", f_fss_eol);
} // for
return F_none;
}
f_array_length_t at = 0;
- f_array_length_t i = 0;
for (; i < data->objects.used; i++) {
fprintf(f_type_output, "0%c", f_string_eol[0]);
}
else {
- f_string_length_t total = 1;
+ f_array_length_t total = 1;
- for (f_string_length_t j = data->contents.array[i].array[0].start; j <= data->contents.array[i].array[0].stop; j++) {
+ for (j = data->contents.array[i].array[0].start; j <= data->contents.array[i].array[0].stop; j++) {
if (!data->buffer.string[j]) continue;
if (data->buffer.string[j] == f_string_eol[0]) {
}
}
else {
- f_string_length_t i = data->contents.array[i].array[0].start;
+ i = data->contents.array[i].array[0].start;
if (!line) {
for (; i <= data->contents.array[i].array[0].stop; i++) {
} // for
}
else {
- f_string_length_t line_current = 0;
+ f_array_length_t line_current = 0;
for (; i <= data->contents.array[i].array[0].stop; i++) {
if (!data->buffer.string[i]) continue;
}
if (data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) {
- f_string_length_t total = 0;
+ f_array_length_t total = 0;
- for (f_string_length_t i = 0; i < data->objects.used; i++) {
+ for (i = 0; i < data->objects.used; i++) {
if (!names[i]) continue;
if (!data->contents.array[i].used) {
continue;
}
- for (f_string_length_t j = data->contents.array[i].array[0].start; j <= data->contents.array[i].array[0].stop; j++) {
+ for (j = data->contents.array[i].array[0].start; j <= data->contents.array[i].array[0].stop; j++) {
if (!data->buffer.string[j]) continue;
if (data->buffer.string[j] == f_string_eol[0]) {
}
if (data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_additional) {
- f_string_length_t line_current = 0;
- f_string_length_t i = 0;
- f_string_length_t j = 0;
-
- for (; i < data->contents.used; i++) {
+ for (f_array_length_t line_current = 0; i < data->contents.used; i++) {
if (!names[i]) continue;
if (!data->contents.array[i].used) {
return F_none;
}
- for (f_string_length_t i = 0; i < data->contents.used; i++) {
+ for (i = 0; i < data->contents.used; i++) {
if (!names[i]) continue;
if (!data->contents.array[i].used) {
printf("%c", f_string_eol[0]);
fll_program_print_help_option(file, 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(file, context, fss_basic_read_short_content, fss_basic_read_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the content (default).");
fll_program_print_help_option(file, 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(file, 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(file, 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(file, 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(file, 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.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_object, fss_basic_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object.");
fll_program_print_help_option(file, context, fss_basic_read_short_select, fss_basic_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index.");
fll_program_print_help_option(file, context, fss_basic_read_short_total, fss_basic_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines.");
fll_program_print_help_option(file, context, fss_basic_read_short_trim, fss_basic_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print.");
printf("%c", f_string_eol[0]);
+ printf(" When specifying both the ");
+ fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object);
+ printf(" parameter and the ");
+ fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_content);
+ printf(" parameter, the entire object and content are printed, including the formatting.%c", f_string_eol[0]);
+ printf(" Both the object and content printed are already escaped.%c", f_string_eol[0]);
+ printf(" Both the object and content are separated by a space.%c", f_string_eol[0]);
+
+ printf("%c", f_string_eol[0]);
+
return F_none;
}
#endif // _di_fss_basic_read_print_help_
fss_basic_read_delete_data(data);
return F_status_set_error(F_parameter);
}
+
+ if (data->parameters[fss_basic_read_parameter_content].result == f_console_result_found) {
+ if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) {
+ fl_color_print(data->error.to.stream, data->context.set.error, "%sCannot specify both the '", fll_error_print_error);
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' and the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_content);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_total);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+
+ fss_basic_read_delete_data(data);
+ return F_status_set_error(F_parameter);
+ }
+ }
}
if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_additional) {
#endif // _di_fss_basic_read_name_
#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_short_select "s"
- #define fss_basic_read_short_total "t"
- #define fss_basic_read_short_trim "T"
-
- #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"
- #define fss_basic_read_long_select "select"
- #define fss_basic_read_long_total "total"
- #define fss_basic_read_long_trim "trim"
+ #define fss_basic_read_short_at "a"
+ #define fss_basic_read_short_content "c"
+ #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_short_select "s"
+ #define fss_basic_read_short_total "t"
+ #define fss_basic_read_short_trim "T"
+
+ #define fss_basic_read_long_at "at"
+ #define fss_basic_read_long_content "content"
+ #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"
+ #define fss_basic_read_long_select "select"
+ #define fss_basic_read_long_total "total"
+ #define fss_basic_read_long_trim "trim"
enum {
fss_basic_read_parameter_help,
fss_basic_read_parameter_version,
fss_basic_read_parameter_at,
+ fss_basic_read_parameter_content,
fss_basic_read_parameter_depth,
fss_basic_read_parameter_empty,
fss_basic_read_parameter_line,
f_console_parameter_t_initialize(f_console_standard_short_debug, f_console_standard_long_debug, 0, 0, f_console_type_inverse), \
f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, 0, f_console_type_inverse), \
f_console_parameter_t_initialize(fss_basic_read_short_at, fss_basic_read_long_at, 0, 1, f_console_type_normal), \
+ f_console_parameter_t_initialize(fss_basic_read_short_content, fss_basic_read_long_content, 0, 0, f_console_type_normal), \
f_console_parameter_t_initialize(fss_basic_read_short_depth, fss_basic_read_long_depth, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_basic_read_short_empty, fss_basic_read_long_empty, 0, 0, f_console_type_normal), \
f_console_parameter_t_initialize(fss_basic_read_short_line, fss_basic_read_long_line, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_basic_read_short_trim, fss_basic_read_long_trim, 0, 0, f_console_type_normal), \
}
- #define fss_basic_read_total_parameters 18
+ #define fss_basic_read_total_parameters 19
#endif // _di_fss_basic_read_defines_
#ifndef _di_fss_basic_read_data_t_
}
}
- f_string_length_t select = 0;
+ f_number_unsigned_t select = 0;
if (data->parameters[fss_basic_read_parameter_select].result == f_console_result_additional) {
const f_string_length_t index = data->parameters[fss_basic_read_parameter_select].additional.array[data->parameters[fss_basic_read_parameter_select].additional.used - 1];
}
}
- f_string_length_t line = 0;
+ f_array_length_t line = 0;
if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_additional) {
- const f_string_length_t index = data->parameters[fss_basic_read_parameter_line].additional.array[data->parameters[fss_basic_read_parameter_line].additional.used - 1];
+ const f_array_length_t index = data->parameters[fss_basic_read_parameter_line].additional.array[data->parameters[fss_basic_read_parameter_line].additional.used - 1];
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[index]));
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &line, range);
bool names[data->objects.used];
+ f_array_length_t i = 0;
+
if (depths.array[0].index_name > 0) {
memset(names, 0, sizeof(bool) * data->objects.used);
f_string_length_t name_length = 0;
if (data->parameters[fss_basic_read_parameter_trim].result == f_console_result_found) {
- for (f_string_length_t i = 0; i < data->objects.used; i++) {
+ for (i = 0; i < data->objects.used; i++) {
name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1;
} // for
}
else {
- for (f_string_length_t i = 0; i < data->objects.used; i++) {
+ for (i = 0; i < data->objects.used; i++) {
name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1;
}
}
else if (depths.array[0].index_name > 0) {
- f_string_length_t total = 0;
+ f_array_length_t total = 0;
- for (f_string_length_t i = 0; i < data->objects.used; i++) {
+ for (i = 0; i < data->objects.used; i++) {
if (!names[i]) continue;
total++;
if (depths.array[0].index_at > 0) {
f_array_length_t at = 0;
- f_array_length_t i = 0;
for (; i < data->objects.used; i++) {
if (names[i]) {
if (at == depths.array[0].value_at) {
print_object(f_type_output, data->buffer, data->objects.array[i]);
- fprintf(f_type_output, "%c", f_string_eol[0]);
+
+ if (data->parameters[fss_basic_read_parameter_content].result == f_console_result_found) {
+ if (data->contents.array[i].used) {
+ fprintf(f_type_output, "%c", f_fss_space);
+ f_print_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[0]);
+ }
+ }
+
+ fprintf(f_type_output, "%c", f_fss_eol);
break;
}
return F_none;
}
- for (f_array_length_t i = 0; i < data->objects.used; i++) {
+ for (i = 0; i < data->objects.used; i++) {
if (!names[i]) continue;
print_object(f_type_output, data->buffer, data->objects.array[i]);
- fprintf(f_type_output, "%c", f_string_eol[0]);
+
+ if (data->parameters[fss_basic_read_parameter_content].result == f_console_result_found) {
+ if (data->contents.array[i].used) {
+ fprintf(f_type_output, "%c", f_fss_space);
+ f_print_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[0]);
+ }
+ }
+
+ fprintf(f_type_output, "%c", f_fss_eol);
} // for
return F_none;
}
f_array_length_t at = 0;
- f_array_length_t i = 0;
for (; i < data->objects.used; i++) {
if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) {
f_string_length_t total = 0;
- for (f_string_length_t i = 0; i < data->objects.used; i++) {
+ for (i = 0; i < data->objects.used; i++) {
if (!names[i]) continue;
if (!data->contents.array[i].used && !include_empty) {
}
if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_additional) {
- f_string_length_t line_current = 0;
+ f_array_length_t line_current = 0;
- for (f_string_length_t i = 0; i < data->contents.used; i++) {
+ for (i = 0; i < data->contents.used; i++) {
if (!names[i]) continue;
if (!data->contents.array[i].used) {
return F_none;
}
- for (f_string_length_t i = 0; i < data->contents.used; i++) {
+ for (i = 0; i < data->contents.used; i++) {
if (!names[i]) continue;
if (!data->contents.array[i].used) {
printf("%c", f_string_eol[0]);
fll_program_print_help_option(file, context, fss_extended_list_read_short_at, fss_extended_list_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_content, fss_extended_list_read_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the content (default).");
fll_program_print_help_option(file, context, fss_extended_list_read_short_depth, fss_extended_list_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth.");
fll_program_print_help_option(file, context, fss_extended_list_read_short_empty, fss_extended_list_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing.");
fll_program_print_help_option(file, context, fss_extended_list_read_short_line, fss_extended_list_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(file, context, fss_extended_list_read_short_name, fss_extended_list_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name.");
- fll_program_print_help_option(file, context, fss_extended_list_read_short_object, fss_extended_list_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_object, fss_extended_list_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object.");
fll_program_print_help_option(file, context, fss_extended_list_read_short_select, fss_extended_list_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index.");
fll_program_print_help_option(file, context, fss_extended_list_read_short_total, fss_extended_list_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines.");
fll_program_print_help_option(file, context, fss_extended_list_read_short_trim, fss_extended_list_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print.");
printf("%c", f_string_eol[0]);
+ printf(" When specifying both the ");
+ fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object);
+ printf(" parameter and the ");
+ fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_content);
+ printf(" parameter, the entire object and content are printed, including the formatting.%c", f_string_eol[0]);
+ printf(" Both the object and content printed are already escaped.%c", f_string_eol[0]);
+ printf(" Both the object and content are separated by an EOL.%c", f_string_eol[0]);
+
+ printf("%c", f_string_eol[0]);
+
return F_none;
}
#endif // _di_fss_extended_list_read_print_help_
fss_extended_list_read_delete_data(data);
return F_status_set_error(F_parameter);
}
+
+ if (data->parameters[fss_extended_list_read_parameter_content].result == f_console_result_found) {
+ if (data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) {
+ fl_color_print(data->error.to.stream, data->context.set.error, "%sCannot specify both the '", fll_error_print_error);
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' and the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_content);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_total);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+
+ fss_extended_list_read_delete_data(data);
+ return F_status_set_error(F_parameter);
+ }
+ }
}
if (data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_additional) {
#endif // _di_fss_extended_list_read_name_
#ifndef _di_fss_extended_list_read_defines_
- #define fss_extended_list_read_short_at "a"
- #define fss_extended_list_read_short_depth "d"
- #define fss_extended_list_read_short_empty "e"
- #define fss_extended_list_read_short_line "l"
- #define fss_extended_list_read_short_name "n"
- #define fss_extended_list_read_short_object "o"
- #define fss_extended_list_read_short_select "s"
- #define fss_extended_list_read_short_total "t"
- #define fss_extended_list_read_short_trim "T"
-
- #define fss_extended_list_read_long_at "at"
- #define fss_extended_list_read_long_depth "depth"
- #define fss_extended_list_read_long_empty "empty"
- #define fss_extended_list_read_long_line "line"
- #define fss_extended_list_read_long_name "name"
- #define fss_extended_list_read_long_object "object"
- #define fss_extended_list_read_long_select "select"
- #define fss_extended_list_read_long_total "total"
- #define fss_extended_list_read_long_trim "trim"
+ #define fss_extended_list_read_short_at "a"
+ #define fss_extended_list_read_short_content "c"
+ #define fss_extended_list_read_short_depth "d"
+ #define fss_extended_list_read_short_empty "e"
+ #define fss_extended_list_read_short_line "l"
+ #define fss_extended_list_read_short_name "n"
+ #define fss_extended_list_read_short_object "o"
+ #define fss_extended_list_read_short_select "s"
+ #define fss_extended_list_read_short_total "t"
+ #define fss_extended_list_read_short_trim "T"
+
+ #define fss_extended_list_read_long_at "at"
+ #define fss_extended_list_read_long_content "content"
+ #define fss_extended_list_read_long_depth "depth"
+ #define fss_extended_list_read_long_empty "empty"
+ #define fss_extended_list_read_long_line "line"
+ #define fss_extended_list_read_long_name "name"
+ #define fss_extended_list_read_long_object "object"
+ #define fss_extended_list_read_long_select "select"
+ #define fss_extended_list_read_long_total "total"
+ #define fss_extended_list_read_long_trim "trim"
enum {
fss_extended_list_read_parameter_help,
fss_extended_list_read_parameter_version,
fss_extended_list_read_parameter_at,
+ fss_extended_list_read_parameter_content,
fss_extended_list_read_parameter_depth,
fss_extended_list_read_parameter_empty,
fss_extended_list_read_parameter_line,
f_console_parameter_t_initialize(f_console_standard_short_debug, f_console_standard_long_debug, 0, 0, f_console_type_inverse), \
f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, 0, f_console_type_inverse), \
f_console_parameter_t_initialize(fss_extended_list_read_short_at, fss_extended_list_read_long_at, 0, 1, f_console_type_normal), \
+ f_console_parameter_t_initialize(fss_extended_list_read_short_content, fss_extended_list_read_long_content, 0, 0, f_console_type_normal), \
f_console_parameter_t_initialize(fss_extended_list_read_short_depth, fss_extended_list_read_long_depth, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_extended_list_read_short_empty, fss_extended_list_read_long_empty, 0, 0, f_console_type_normal), \
f_console_parameter_t_initialize(fss_extended_list_read_short_line, fss_extended_list_read_long_line, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_extended_list_read_short_trim, fss_extended_list_read_long_trim, 0, 0, f_console_type_normal), \
}
- #define fss_extended_list_read_total_parameters 18
+ #define fss_extended_list_read_total_parameters 19
#endif // _di_fss_extended_list_read_defines_
#ifndef _di_fss_extended_list_read_data_t_
}
{
- f_string_length_t select = 0;
+ f_number_unsigned_t select = 0;
if (data->parameters[fss_extended_list_read_parameter_select].result == f_console_result_additional) {
const f_string_length_t index = data->parameters[fss_extended_list_read_parameter_select].additional.array[data->parameters[fss_extended_list_read_parameter_select].additional.used - 1];
}
}
- f_string_length_t line = 0;
+ f_array_length_t line = 0;
if (data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_additional) {
- const f_string_length_t index = data->parameters[fss_extended_list_read_parameter_line].additional.array[data->parameters[fss_extended_list_read_parameter_line].additional.used - 1];
+ const f_array_length_t index = data->parameters[fss_extended_list_read_parameter_line].additional.array[data->parameters[fss_extended_list_read_parameter_line].additional.used - 1];
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[index]));
- f_number_unsigned_t number = 0;
-
- status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range);
+ status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &line, range);
if (F_status_is_error(status)) {
fll_error_parameter_integer_print(data->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_list_read_long_line, arguments.argv[index]);
#endif // _di_fss_extended_list_read_main_process_file_
#ifndef _di_fss_extended_list_read_main_process_for_depth_
- f_return_status fss_extended_list_read_main_process_for_depth(const f_console_arguments_t arguments, fss_extended_list_read_data_t *data, const f_string_t filename, const fss_extended_list_read_depth_t depth_setting, const f_string_length_t line) {
+ f_return_status fss_extended_list_read_main_process_for_depth(const f_console_arguments_t arguments, fss_extended_list_read_data_t *data, const f_string_t filename, const fss_extended_list_read_depth_t depth_setting, const f_array_length_t line) {
f_status_t status = F_none;
f_fss_items_t *items = &data->nest.depth[depth_setting.depth];
bool names[items->used];
+ f_array_length_t i = 0;
+ f_array_length_t j = 0;
+
if (depth_setting.index_name > 0) {
memset(names, 0, sizeof(bool) * items->used);
value_range.stop = depth_setting.value_name.used - 1;
if (data->parameters[fss_extended_list_read_parameter_trim].result == f_console_result_found) {
- for (f_string_length_t i = 0; i < items->used; i++) {
+ for (i = 0; i < items->used; i++) {
if (fl_string_dynamic_partial_compare_trim(data->buffer, depth_setting.value_name, items->array[i].object, value_range) == F_equal_to) {
names[i] = 1;
}
} // for
}
else {
- for (f_string_length_t i = 0; i < items->used; i++) {
+ for (i = 0; i < items->used; i++) {
if (fl_string_dynamic_partial_compare(data->buffer, depth_setting.value_name, items->array[i].object, value_range) == F_equal_to) {
names[i] = 1;
}
return F_none;
}
else if (depth_setting.index_name > 0) {
- f_string_length_t total = 0;
+ f_array_length_t total = 0;
- for (f_string_length_t i = 0; i < items->used; i++) {
+ for (i = 0; i < items->used; i++) {
if (!names[i]) continue;
total++;
if (depth_setting.index_at > 0) {
if (depth_setting.value_at < items->used && names[depth_setting.value_at]) {
print_object(f_type_output, data->buffer, items->array[depth_setting.value_at].object);
- fprintf(f_type_output, "%c", f_string_eol[0]);
+
+ if (data->parameters[fss_extended_list_read_parameter_content].result == f_console_result_found) {
+ if (items->array[depth_setting.value_at].content.used) {
+ fprintf(f_type_output, "%c", f_fss_eol);
+ f_print_dynamic_partial(f_type_output, data->buffer, items->array[depth_setting.value_at].content.array[0]);
+ }
+ else {
+ fprintf(f_type_output, "%c", f_fss_eol);
+ }
+ }
+
+ fprintf(f_type_output, "%c", f_fss_eol);
}
return F_none;
}
- for (f_array_length_t i = 0; i < items->used; i++) {
+ for (i = 0; i < items->used; i++) {
if (names[i]) {
print_object(f_type_output, data->buffer, items->array[i].object);
- fprintf(f_type_output, "%c", f_string_eol[0]);
+
+ if (data->parameters[fss_extended_list_read_parameter_content].result == f_console_result_found) {
+ if (items->array[i].content.used) {
+ fprintf(f_type_output, "%c", f_fss_eol);
+ f_print_dynamic_partial(f_type_output, data->buffer, items->array[i].content.array[0]);
+ }
+ else {
+ fprintf(f_type_output, "%c", f_fss_eol);
+ }
+ }
+
+ fprintf(f_type_output, "%c", f_fss_eol);
}
} // for
}
f_array_length_t at = 0;
- f_array_length_t i = 0;
for (; i < items->used; i++) {
fprintf(f_type_output, "0%c", f_string_eol[0]);
}
else {
- f_string_length_t total = 1;
+ f_array_length_t total = 1;
- for (f_string_length_t j = items->array[i].content.array[0].start; j <= items->array[i].content.array[0].stop; j++) {
+ for (j = items->array[i].content.array[0].start; j <= items->array[i].content.array[0].stop; j++) {
if (!data->buffer.string[j]) continue;
if (data->buffer.string[j] == f_string_eol[0]) {
}
}
else {
- f_string_length_t i = items->array[i].content.array[0].start;
+ i = items->array[i].content.array[0].start;
if (!line) {
for (; i <= items->array[i].content.array[0].stop; i++) {
} // for
}
else {
- f_string_length_t line_current = 0;
+ f_array_length_t line_current = 0;
for (; i <= items->array[i].content.array[0].stop; i++) {
if (!data->buffer.string[i]) continue;
}
if (data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) {
- f_string_length_t total = 0;
+ f_array_length_t total = 0;
- for (f_string_length_t i = 0; i < items->used; i++) {
+ for (i = 0; i < items->used; i++) {
if (!names[i]) continue;
if (!items->array[i].content.used) {
continue;
}
- for (f_string_length_t j = items->array[i].content.array[0].start; j <= items->array[i].content.array[0].stop; j++) {
+ for (j = items->array[i].content.array[0].start; j <= items->array[i].content.array[0].stop; j++) {
if (!data->buffer.string[j]) continue;
if (data->buffer.string[j] == f_string_eol[0]) {
}
if (data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_additional) {
- f_string_length_t line_current = 0;
- f_string_length_t i = 0;
- f_string_length_t j = 0;
+ f_array_length_t line_current = 0;
for (; i < items->used; i++) {
if (!names[i]) continue;
return F_none;
}
- for (f_string_length_t i = 0; i < items->used; i++) {
+ for (i = 0; i < items->used; i++) {
if (!names[i]) continue;
if (!items->array[i].content.used) {
* @see fss_extended_list_read_main_process_file()
*/
#ifndef _di_fss_extended_list_read_main_process_for_depth_
- extern f_return_status fss_extended_list_read_main_process_for_depth(const f_console_arguments_t arguments, fss_extended_list_read_data_t *data, const f_string_t filename, const fss_extended_list_read_depth_t depth_setting, const f_string_length_t line) f_gcc_attribute_visibility_internal;
+ extern f_return_status fss_extended_list_read_main_process_for_depth(const f_console_arguments_t arguments, fss_extended_list_read_data_t *data, const f_string_t filename, const fss_extended_list_read_depth_t depth_setting, const f_array_length_t line) f_gcc_attribute_visibility_internal;
#endif // _di_fss_extended_list_read_main_process_for_depth_
#ifdef __cplusplus
printf("%c", f_string_eol[0]);
fll_program_print_help_option(file, context, fss_extended_read_short_at, fss_extended_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_content, fss_extended_read_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the content (default).");
fll_program_print_help_option(file, context, fss_extended_read_short_depth, fss_extended_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth.");
fll_program_print_help_option(file, context, fss_extended_read_short_empty, fss_extended_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing.");
fll_program_print_help_option(file, context, fss_extended_read_short_line, fss_extended_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(file, context, fss_extended_read_short_name, fss_extended_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name.");
- fll_program_print_help_option(file, context, fss_extended_read_short_object, fss_extended_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_object, fss_extended_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object.");
fll_program_print_help_option(file, context, fss_extended_read_short_select, fss_extended_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index.");
fll_program_print_help_option(file, context, fss_extended_read_short_total, fss_extended_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines.");
fll_program_print_help_option(file, context, fss_extended_read_short_trim, fss_extended_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print.");
printf("%c", f_string_eol[0]);
+ printf(" When specifying both the ");
+ fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object);
+ printf(" parameter and the ");
+ fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_content);
+ printf(" parameter, the entire object and content are printed, including the formatting.%c", f_string_eol[0]);
+ printf(" Both the object and content printed are already escaped.%c", f_string_eol[0]);
+ printf(" Both the object and content are separated by a space.%c", f_string_eol[0]);
+
+ printf("%c", f_string_eol[0]);
+
return F_none;
}
#endif // _di_fss_extended_read_print_help_
fss_extended_read_delete_data(data);
return F_status_set_error(F_parameter);
}
+
+ if (data->parameters[fss_extended_read_parameter_content].result == f_console_result_found) {
+ if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) {
+ fl_color_print(data->error.to.stream, data->context.set.error, "%sCannot specify both the '", fll_error_print_error);
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' and the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_content);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_total);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+
+ fss_extended_read_delete_data(data);
+ return F_status_set_error(F_parameter);
+ }
+ }
}
if (data->parameters[fss_extended_read_parameter_line].result == f_console_result_additional) {
#endif // _di_fss_extended_read_name_
#ifndef _di_fss_extended_read_defines_
- #define fss_extended_read_short_at "a"
- #define fss_extended_read_short_depth "d"
- #define fss_extended_read_short_empty "e"
- #define fss_extended_read_short_line "l"
- #define fss_extended_read_short_name "n"
- #define fss_extended_read_short_object "o"
- #define fss_extended_read_short_select "s"
- #define fss_extended_read_short_total "t"
- #define fss_extended_read_short_trim "T"
-
- #define fss_extended_read_long_at "at"
- #define fss_extended_read_long_depth "depth"
- #define fss_extended_read_long_empty "empty"
- #define fss_extended_read_long_line "line"
- #define fss_extended_read_long_name "name"
- #define fss_extended_read_long_object "object"
- #define fss_extended_read_long_select "select"
- #define fss_extended_read_long_total "total"
- #define fss_extended_read_long_trim "trim"
+ #define fss_extended_read_short_at "a"
+ #define fss_extended_read_short_content "c"
+ #define fss_extended_read_short_depth "d"
+ #define fss_extended_read_short_empty "e"
+ #define fss_extended_read_short_line "l"
+ #define fss_extended_read_short_name "n"
+ #define fss_extended_read_short_object "o"
+ #define fss_extended_read_short_select "s"
+ #define fss_extended_read_short_total "t"
+ #define fss_extended_read_short_trim "T"
+
+ #define fss_extended_read_long_at "at"
+ #define fss_extended_read_long_content "content"
+ #define fss_extended_read_long_depth "depth"
+ #define fss_extended_read_long_empty "empty"
+ #define fss_extended_read_long_line "line"
+ #define fss_extended_read_long_name "name"
+ #define fss_extended_read_long_object "object"
+ #define fss_extended_read_long_select "select"
+ #define fss_extended_read_long_total "total"
+ #define fss_extended_read_long_trim "trim"
enum {
fss_extended_read_parameter_help,
fss_extended_read_parameter_version,
fss_extended_read_parameter_at,
+ fss_extended_read_parameter_content,
fss_extended_read_parameter_depth,
fss_extended_read_parameter_empty,
fss_extended_read_parameter_line,
f_console_parameter_t_initialize(f_console_standard_short_debug, f_console_standard_long_debug, 0, 0, f_console_type_inverse), \
f_console_parameter_t_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, 0, f_console_type_inverse), \
f_console_parameter_t_initialize(fss_extended_read_short_at, fss_extended_read_long_at, 0, 1, f_console_type_normal), \
+ f_console_parameter_t_initialize(fss_extended_read_short_content, fss_extended_read_long_content, 0, 0, f_console_type_normal), \
f_console_parameter_t_initialize(fss_extended_read_short_depth, fss_extended_read_long_depth, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_extended_read_short_empty, fss_extended_read_long_empty, 0, 0, f_console_type_normal), \
f_console_parameter_t_initialize(fss_extended_read_short_line, fss_extended_read_long_line, 0, 1, f_console_type_normal), \
f_console_parameter_t_initialize(fss_extended_read_short_trim, fss_extended_read_long_trim, 0, 0, f_console_type_normal), \
}
- #define fss_extended_read_total_parameters 18
+ #define fss_extended_read_total_parameters 19
#endif // _di_fss_extended_read_defines_
#ifndef _di_fss_extended_read_data_t_
}
}
- f_string_length_t select = 0;
+ f_number_unsigned_t select = 0;
if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_additional) {
- const f_string_length_t index = data->parameters[fss_extended_read_parameter_select].additional.array[data->parameters[fss_extended_read_parameter_select].additional.used - 1];
+ const f_array_length_t index = data->parameters[fss_extended_read_parameter_select].additional.array[data->parameters[fss_extended_read_parameter_select].additional.used - 1];
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[index]));
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &select, range);
}
}
- f_string_length_t line = 0;
+ f_array_length_t line = 0;
if (data->parameters[fss_extended_read_parameter_line].result == f_console_result_additional) {
- const f_string_length_t index = data->parameters[fss_extended_read_parameter_line].additional.array[data->parameters[fss_extended_read_parameter_line].additional.used - 1];
+ const f_array_length_t index = data->parameters[fss_extended_read_parameter_line].additional.array[data->parameters[fss_extended_read_parameter_line].additional.used - 1];
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[index]));
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &line, range);
bool names[data->objects.used];
+ f_array_length_t i = 0;
+ f_array_length_t j = 0;
+
if (depths.array[0].index_name > 0) {
memset(names, 0, sizeof(bool) * data->objects.used);
f_string_length_t name_length = 0;
if (data->parameters[fss_extended_read_parameter_trim].result == f_console_result_found) {
- for (f_string_length_t i = 0; i < data->objects.used; i++) {
+ for (i = 0; i < data->objects.used; i++) {
name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1;
} // for
}
else {
- for (f_string_length_t i = 0; i < data->objects.used; i++) {
+ for (i = 0; i < data->objects.used; i++) {
name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1;
}
}
else if (depths.array[0].index_name > 0) {
- f_string_length_t total = 0;
+ f_array_length_t total = 0;
- for (f_string_length_t i = 0; i < data->objects.used; i++) {
+ for (i = 0; i < data->objects.used; i++) {
if (!names[i]) continue;
total++;
if (depths.array[0].index_at > 0) {
f_array_length_t at = 0;
- f_array_length_t i = 0;
- for (; i < data->objects.used; i++) {
+ for (j = 0; i < data->objects.used; i++) {
if (names[i]) {
if (at == depths.array[0].value_at) {
print_object(f_type_output, data->buffer, data->objects.array[i]);
- fprintf(f_type_output, "%c", f_string_eol[0]);
+
+ if (data->parameters[fss_extended_read_parameter_content].result == f_console_result_found) {
+ if (data->contents.array[i].used) {
+ fprintf(f_type_output, "%c", f_fss_space);
+
+ for (j = 0; j < data->contents.array[i].used; j++) {
+
+ f_print_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[j]);
+
+ if (j + 1 < data->contents.array[i].used) {
+ fprintf(f_type_output, "%c", f_fss_space);
+ }
+ } // for
+ }
+ }
+
+ fprintf(f_type_output, "%c", f_fss_eol);
break;
}
return F_none;
}
- for (f_string_length_t i = 0; i < data->objects.used; i++) {
+ for (i = 0; i < data->objects.used; i++) {
if (!names[i]) continue;
print_object(f_type_output, data->buffer, data->objects.array[i]);
- fprintf(f_type_output, "%c", f_string_eol[0]);
+
+ if (data->parameters[fss_extended_read_parameter_content].result == f_console_result_found) {
+ if (data->contents.array[i].used) {
+ fprintf(f_type_output, "%c", f_fss_space);
+
+ for (j = 0; j < data->contents.array[i].used; j++) {
+
+ f_print_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[j]);
+
+ if (j + 1 < data->contents.array[i].used) {
+ fprintf(f_type_output, "%c", f_fss_space);
+ }
+ } // for
+ }
+ }
+
+ fprintf(f_type_output, "%c", f_fss_eol);
} // for
return F_none;
}
f_array_length_t at = 0;
- f_array_length_t i = 0;
for (; i < data->objects.used; i++) {
if (data->parameters[fss_extended_read_parameter_line].result == f_console_result_additional) {
if (!line) {
if (data->contents.array[i].used > 0) {
- f_string_length_t j = 0;
+ j = 0;
if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_additional) {
if (select < data->contents.array[i].used) {
}
if (data->contents.array[i].used > 0) {
- f_string_length_t j = 0;
+ j = 0;
if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_additional) {
if (select < data->contents.array[i].used) {
}
if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) {
- f_string_length_t total = 0;
+ f_array_length_t total = 0;
- for (f_string_length_t i = 0; i < data->objects.used; i++) {
+ for (i = 0; i < data->objects.used; i++) {
if (!names[i]) {
continue;
}
}
if (data->parameters[fss_extended_read_parameter_line].result == f_console_result_additional) {
- f_string_length_t line_current = 0;
- f_string_length_t i = 0;
- f_string_length_t j = 0;
+ f_array_length_t line_current = 0;
- for (; i < data->contents.used; i++) {
+ for (i = 0, j = 0; i < data->contents.used; i++) {
if (!names[i]) continue;
if (!data->contents.array[i].used) {
return F_none;
}
- f_string_length_t i = 0;
- f_string_length_t j = 0;
-
- for (; i < data->contents.used; i++) {
+ for (i = 0, j = 0; i < data->contents.used; i++) {
if (!names[i]) continue;
if (!data->contents.array[i].used) {