ls/
ls.rs

1use rust_car::reader;
2
3/// e.g. ```cargo run --example ls file```
4/// the example list file infomation in carv1-basic.car file
5fn main() {
6    let file_name = std::env::args().nth(1);
7    let path = file_name.as_ref().map(|f| f.into()).unwrap_or_else(|| {
8        let file = std::path::Path::new("test");
9        file.join("carv1-basic.car")
10    });
11    let file = std::fs::File::open(path).unwrap();
12    let mut reader = reader::new_v1(file).unwrap();
13    rust_car::utils::list(&mut reader).unwrap();
14}