ls-option

Crates.iols-option
lib.rsls-option
version0.1.5
sourcesrc
created_at2024-04-10 15:22:20.327765
updated_at2024-04-16 02:45:32.285131
descriptiona tiny and simple option tools for ls-like functionality
homepage
repositoryhttps://github.com/cncsmonster/ls-option
max_upload_size
id1203699
size12,389
(CNCSMonster)

documentation

README

ls-option: a tiny and simple to used library for ls-like functionality in pure Rust

Quick Start

# 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);

License

MIT

Commit count: 12

cargo fmt