diff --git a/spell-check.R b/spell-check.R index 7e0fc80..56f63be 100644 --- a/spell-check.R +++ b/spell-check.R @@ -14,7 +14,11 @@ dict_file <- arguments[1] arguments <- arguments[-1] # if there are arguments, check those files, otherwise check all markdown & rmd files if (length(arguments) > 0 && arguments[1] != "") { - files <- arguments[grepl(file_pattern, arguments)] + files_glob <- strsplit(arguments, " ") |> + unlist() |> + Sys.glob() |> + unique() + files <- grep(file_pattern, files_glob, value = TRUE) } else { files <- list.files(pattern = file_pattern, recursive = TRUE, full.names = TRUE) }