Skip to content

Commit 7421836

Browse files
committed
Improve cli error message on invalid glob
1 parent 9d460e6 commit 7421836

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cli/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,9 @@ fn collect_paths<'a>(paths: impl Iterator<Item = &'a str>) -> error::Result<Vec<
339339
if Path::new(path).exists() {
340340
incorporate_path(path, positive);
341341
} else {
342-
for path in glob(path)? {
342+
let paths =
343+
glob(path).map_err(Error::wrap(|| format!("Invalid glob pattern {:?}", path)))?;
344+
for path in paths {
343345
if let Some(path) = path?.to_str() {
344346
incorporate_path(path, positive);
345347
}

0 commit comments

Comments
 (0)