| Crates.io | ls-option |
| lib.rs | ls-option |
| version | 0.1.5 |
| created_at | 2024-04-10 15:22:20.327765+00 |
| updated_at | 2024-04-16 02:45:32.285131+00 |
| description | a tiny and simple option tools for ls-like functionality |
| homepage | |
| repository | https://github.com/cncsmonster/ls-option |
| max_upload_size | |
| id | 1203699 |
| size | 12,389 |
# try to list all files with suffix `.rs` in current path
cargo run --example list_all_rs
# try to list paths in an unexisted path
cargo run --example list_unexisted_path
Example 1:
use ls_option::*;
let fs = ListOption::default()
// allow to show file
.file(true)
// not allow to show dir
.dir(false)
// allow to show unhidden
.unhidden(true)
// not allow to show hidden
.hidden(false)
// walk recursively to search path
.recursive(true)
// only show path with one of these suffix
.sufs(vec![".rs"])
// start list the expected path search from `.`
.list(".");
dbg!(fs);