From 9e6a9cf40b4540fbf9f5c3d1de0fdf5b56d0a062 Mon Sep 17 00:00:00 2001 From: MisileLaboratory Date: Mon, 3 Apr 2023 10:18:36 +0000 Subject: [PATCH] [ci skip] not ready --- src/commands/list.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/commands/list.rs b/src/commands/list.rs index c6c2823..270da8a 100644 --- a/src/commands/list.rs +++ b/src/commands/list.rs @@ -88,7 +88,13 @@ pub fn list_archive_contents( } }, SevenZip => { - unimplemented!(); // todo implement 7z list + let mut a = Vec::new(); + + sevenz_rust::decompress_file_with_extract_fn(archive_path, ".", |entry, _, _| { + a.push(Ok(FileInArchive{path: entry.name().into(), is_dir: entry.is_directory()})); + Ok(true) + }); + Box::new(a.into_iter()) } Gzip | Bzip | Lz4 | Lzma | Snappy | Zstd => { panic!("Not an archive! This should never happen, if it does, something is wrong with `CompressionFormat::is_archive()`. Please report this error!");