1 use std::io::prelude::*;
4 std::process::exit(real_main());
7 fn real_main() -> i32 {
8 let args: Vec<_> = std::env::args().collect();
10 println!("Usage: {} <filename>", args[0]);
13 let fname = std::path::Path::new(&*args[1]);
14 let zipfile = std::fs::File::open(&fname).unwrap();
16 let mut archive = zip::ZipArchive::new(zipfile).unwrap();
18 let mut file = match archive.by_name("test/lorem_ipsum.txt") {
21 println!("File test/lorem_ipsum.txt not found");
26 let mut contents = String::new();
27 file.read_to_string(&mut contents).unwrap();
28 println!("{}", contents);