wrote this base code a while ago, figured i'd put it on git

This commit is contained in:
SadlyNotSappho 2023-07-09 15:36:19 -07:00
parent 475ac7c332
commit 7646293220
3 changed files with 35 additions and 0 deletions

2
.gitignore vendored
View File

@ -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

10
Cargo.toml Normal file
View File

@ -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"

23
src/main.rs Normal file
View File

@ -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();
}