status = fl_conversion_string_to_number_unsigned(arguments.argv[index], range, &number);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, iki_read_long_at, arguments.argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, f_console_symbol_long_enable iki_read_long_at, arguments.argv[index]);
status = F_status_set_error(F_parameter);
}
main->at = number;
- if (main->parameters[iki_read_parameter_total].result == f_console_result_found) {
+ if (main->parameters[iki_read_parameter_whole].result == f_console_result_found) {
if (main->error.verbosity != f_console_verbosity_quiet) {
flockfile(main->error.to.stream);
fl_print_format("%c%[%sCannot specify the '%]", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, main->error.context);
fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_at, main->error.notable);
fl_print_format("%[' parameter with the '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_total, main->error.notable);
+ fl_print_format("%[%s%s%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, iki_read_long_whole, main->error.notable);
fl_print_format("%[' parameter.%]%c", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s[0]);
funlockfile(main->error.to.stream);
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], range, &number);
if (F_status_is_error(status)) {
- fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, iki_read_long_line, arguments.argv[index]);
+ fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, f_console_symbol_long_enable iki_read_long_line, arguments.argv[index]);
status = F_status_set_error(F_parameter);
}
f_array_length_t index = 0;
f_array_length_t i = 0;
f_array_length_t j = 0;
+ f_array_length_t matches = 0;
buffer_range->start = 0;
for (; i < main->parameters[iki_read_parameter_name].values.used; ++i) {
if (status == F_equal_to) {
unmatched = F_false;
+ if (main->parameters[iki_read_parameter_at].result == f_console_result_additional) {
+ if (matches++ != main->at) continue;
+ }
+
if (substitutionss[j].used) {
iki_read_substitutions_print(*main, *variable, *content, *ranges, substitutionss[j], j, content_only);
}
else status = F_none;
}
else if (ranges->used) {
- f_array_length_t i = 0;
- f_array_length_t j = 0;
+ if (main->parameters[iki_read_parameter_at].result == f_console_result_additional) {
+ if (main->at < ranges->used) {
+ flockfile(main->output.stream);
- flockfile(main->output.stream);
+ if (substitutionss[main->at].used) {
+ iki_read_substitutions_print(*main, *variable, *content, *ranges, substitutionss[main->at], main->at, content_only);
+ }
+ else {
+ f_print_dynamic_partial(main->buffer, ranges->array[main->at], main->output.stream);
+ }
+
+ f_print_character(f_string_eol_s[0], main->output.stream);
- for (; i < ranges->used; ++i) {
+ funlockfile(main->output.stream);
- if (substitutionss[i].used) {
- iki_read_substitutions_print(*main, *variable, *content, *ranges, substitutionss[i], i, content_only);
+ status = F_none;
}
else {
- f_print_dynamic_partial(main->buffer, ranges->array[i], main->output.stream);
+ status = F_data_not;
}
+ }
+ else {
+ flockfile(main->output.stream);
- f_print_character(f_string_eol_s[0], main->output.stream);
- } // for
+ for (f_array_length_t i = 0; i < ranges->used; ++i) {
- funlockfile(main->output.stream);
+ if (substitutionss[i].used) {
+ iki_read_substitutions_print(*main, *variable, *content, *ranges, substitutionss[i], i, content_only);
+ }
+ else {
+ f_print_dynamic_partial(main->buffer, ranges->array[i], main->output.stream);
+ }
+
+ f_print_character(f_string_eol_s[0], main->output.stream);
+ } // for
+
+ funlockfile(main->output.stream);
- status = F_none;
+ status = F_none;
+ }
}
else {
status = F_data_not;
f_array_length_t i = buffer_range.start;
f_array_length_t j = 0;
f_array_length_t k = 0;
+ f_array_length_t stop = variable->used;
range = buffer_range;
name_range.start = 0;
flockfile(main->output.stream);
- while (i <= range.stop && j < variable->used) {
+ while (i <= range.stop && j < stop) {
if (i < variable->array[j].start) {
range.start = i;
total = variable->used;
}
+ // if that at position is within the actual total, then the total at the given position is 1, otherwise is 0.
+ if (main->parameters[iki_read_parameter_at].result == f_console_result_additional) {
+ if (main->at < total) {
+ total = 1;
+ }
+ else {
+ total = 0;
+ }
+ }
+
fll_print_format("%ul%c", main->output.stream, total, f_string_eol_s[0]);
return F_none;