Closed epage closed 4 years ago
Having a file type filter sounds like aa great idea. Not sure about the default, though.
I'm partially against it since it is not what I would have expected my shell to produce; I believe the default behavior should emulate a shell as much as possible.
@killercup
I wouldn't restrict it to files by default.
I could see having a .file_type(globwalk.FileType::File | globwalk.FileType::Dir || globwalk.FileType::SymLink) to give users control over what is returned.
That sounds like a good idea to me. Maybe also add a files_only()
shorthand.
Solved in a timely manner in v0.8.0
In a lot of cases, people will do globs like
*.rs
which 99% of the time will only return files. In this case, if they then refactor and switch to*
, they can now start to get directories.imo it seems less surprising if globwalk only returned files by default.
I could see having a
.file_type(globwalk.FileType::File | globwalk.FileType::Dir || globwalk.FileType::SymLink)
to give users control over what is returned.