mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-08 12:35:41 +00:00
Show info for list --tree
This commit is contained in:
parent
2adcfb364f
commit
a07bc72faf
15
src/list.rs
15
src/list.rs
@ -1,8 +1,12 @@
|
||||
//! Implementation of the 'list' command, print list of files in an archive
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::{
|
||||
io::Write,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
use self::tree::Tree;
|
||||
use crate::info;
|
||||
|
||||
/// Options controlling how archive contents should be listed
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
@ -31,7 +35,14 @@ pub fn list_files(
|
||||
println!("Archive: {}", archive.display());
|
||||
|
||||
if list_options.tree {
|
||||
let tree: Tree = files.into_iter().collect::<crate::Result<Tree>>()?;
|
||||
let tree: Tree = files
|
||||
.into_iter()
|
||||
.map(|file| {
|
||||
let file = file?;
|
||||
info!(inaccessible, "Processing file: {}", file.path.display());
|
||||
Ok(file)
|
||||
})
|
||||
.collect::<crate::Result<Tree>>()?;
|
||||
tree.print();
|
||||
} else {
|
||||
for file in files {
|
||||
|
Loading…
x
Reference in New Issue
Block a user