wrote this base code a while ago, figured i'd put it on git
This commit is contained in:
parent
475ac7c332
commit
7646293220
|
@ -14,3 +14,5 @@ Cargo.lock
|
||||||
# MSVC Windows builds of rustc generate these, which store debugging information
|
# MSVC Windows builds of rustc generate these, which store debugging information
|
||||||
*.pdb
|
*.pdb
|
||||||
|
|
||||||
|
# Added by cargo
|
||||||
|
/target
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
[package]
|
||||||
|
name = "archive-helper"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
clap = { version = "4.3.11", features = ["derive"] }
|
||||||
|
compress-tools = "0.14.3"
|
|
@ -0,0 +1,23 @@
|
||||||
|
use std::{path::Path, fs::File};
|
||||||
|
|
||||||
|
use clap::Parser;
|
||||||
|
use compress_tools::*;
|
||||||
|
|
||||||
|
#[derive(Parser, Debug)]
|
||||||
|
struct Args {
|
||||||
|
#[arg(short, long)]
|
||||||
|
input: String,
|
||||||
|
|
||||||
|
#[arg(short, long)]
|
||||||
|
output: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let args = Args::parse();
|
||||||
|
println!("{:?}", args);
|
||||||
|
|
||||||
|
let mut source = File::open(args.input).unwrap();
|
||||||
|
let dest = Path::new(&args.output);
|
||||||
|
|
||||||
|
uncompress_archive(&mut source, &dest, Ownership::Preserve).unwrap();
|
||||||
|
}
|
Loading…
Reference in New Issue