Print a summary of changed files.
The output is intentionally limited (cap=8) to keep logs compact.
This routine is suppressed in quiet mode (w%verbosity < 0).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(string_t), | intent(in), | allocatable | :: | files(:) | ||
| integer, | intent(in) | :: | changed_idx(:) | |||
| integer, | intent(in) | :: | changed_count | |||
| type(watch_opts_t), | intent(in) | :: | w |
subroutine report_changes(files, changed_idx, changed_count, w) type(string_t), allocatable, intent(in) :: files(:) integer, intent(in) :: changed_idx(:) integer, intent(in) :: changed_count type(watch_opts_t), intent(in) :: w integer :: i, cap, idx if (w%verbosity < 0) return cap = 8 write(output_unit,'(a)') & colorize("change |", color_fg='yellow_intense', style='bold_on') // " " // & colorize(str(changed_count), color_fg='yellow_intense', style='bold_on') // & " files (debounced " // colorize(ftoa(w%debounce), color_fg='yellow') // "s)" if (changed_count == 0) return if (.not. allocated(files)) return do i = 1, min(changed_count, cap) idx = changed_idx(i) if (idx < 1 .or. idx > size(files)) cycle write(output_unit,'(a)') " | " // colorize(trim(files(idx)%s), color_fg='yellow') end do if (changed_count > cap) then write(output_unit,'(a)') & " | ... +" // colorize(str(changed_count-cap), color_fg='yellow') // " more" end if end subroutine report_changes