The Fortran files under dir, selected with the [files] settings of its configuration and
the command line.
| 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) | :: | dir |
the directory, as given on the command line |
||
| type(string_t), | intent(out), | allocatable | :: | files(:) |
paths of the files found |
|
| integer, | intent(inout) | :: | status |
exit status so far; set to |
subroutine directory_files(cli, cache, dir, files, status) !! The Fortran files under `dir`, selected with the `[files]` settings of its configuration and !! the command line. 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) :: dir !! the directory, as given on the command line type(string_t), allocatable, intent(out) :: files(:) !! paths of the files found integer, intent(inout) :: status !! exit status so far; set to `EXIT_ERROR` if the !! configuration cannot be read type(config_t) :: cfg type(string_t), allocatable :: extensions(:), exclude(:) integer :: stat character(len=:), allocatable :: errmsg extensions = default_extensions() exclude = default_exclude() call config_for(cli, cache, absolute_path(dir), cfg, stat, errmsg) if (stat /= 0) then write (error_unit, '(a)') 'error: '//errmsg status = EXIT_ERROR allocate (files(0)) return end if if (allocated(cfg%extensions)) extensions = cfg%extensions if (allocated(cfg%exclude)) exclude = cfg%exclude if (allocated(cli%extensions)) extensions = cli%extensions exclude = [exclude, cli%exclude] call collect_files(dir, extensions, exclude, files) end subroutine directory_files