#search-path #directory #recursion #file #suffix #file-search #tiny

ls-option

a tiny and simple option tools for ls-like functionality

6 releases

0.1.5 Apr 16, 2024
0.1.4 Apr 16, 2024

#919 in Filesystem

Download history 4/week @ 2024-09-20 1/week @ 2024-09-27

189 downloads per month

MIT license

11KB
180 lines

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

No runtime deps

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy