Format file path in place (or write it to standard output, or report it with --check /
--diff), with the configuration of its directory, and return the exit status.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(cli_t), | intent(in) | :: | cli |
the parsed command line |
||
| type(config_cache_t), | intent(inout) | :: | cache |
configurations found so far |
||
| character(len=*), | intent(in) | :: | path |
the file, as given on the command line or found in a directory |
integer function process_file(cli, cache, path) result(status) !! Format file `path` in place (or write it to standard output, or report it with `--check` / !! `--diff`), with the configuration of its directory, and return the exit status. type(cli_t), intent(in) :: cli !! the parsed command line type(config_cache_t), intent(inout) :: cache !! configurations found so far character(len=*), intent(in) :: path !! the file, as given on the command line or found in a directory character(len=:), allocatable :: text, errmsg, dir integer :: stat call read_file(path, text, stat, errmsg) if (stat /= 0) then write (error_unit, '(a)') path//': error: '//errmsg status = EXIT_ERROR return end if dir = parent_directory(absolute_path(path)) status = process_text(cli, cache, path, dir, text, cli%stdout) end function process_file