mod tar;
use clap::Parser;
use std::path::Path;
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct Args {
#[arg(index = 1)]
input: String,
#[arg(index = 2)]
output: Option<String>,
}
fn main() {
let args = Args::parse();
let out = match args.output {
Some(file) => file,
None => {
let p = Path::new(&args.input);
format!("{}{}", p.file_name().unwrap().to_str().unwrap(), ".tar")
}
};
tar::compress(Path::new(&args.input), out);
}