BurntSushi / walkdir

Rust library for walking directories recursively.
The Unlicense
1.21k stars 106 forks source link

cli switch justfiles for displaying just files like find type f #143

Open omac777 opened 3 years ago

omac777 commented 3 years ago

Made is_dir() public because it's useful for filtering out directories when we just want to print out files with their full paths.

For the demo walkdir-list too, I added a new clap switch --justfiles to print out only paths of type file NOT TYPE DIRECTORY. In other words like the find tool -type f The equivalent of:

find blahdir -type f -print

is:

walkdir-list --justfiles blahdir

or

walkdir-list -j blahdir
BurntSushi commented 3 years ago

I guess adding a new CLI flag is fine. But please call it --files.

But exporting a new is_dir method is unnecessary and I don't know why that's included here. You can query it via the file type.