use crate::error::UtilError;
use blockless_car::utils::archive_local;
use std::path::Path;
#[derive(Debug, clap::Parser)]
pub struct ArchiveCommand {
#[clap(short, help = "the car file for archive.")]
car: String,
#[clap(short, help = "the source directory to be archived.")]
source: String,
}
impl ArchiveCommand {
pub(crate) fn execute(&self) -> Result<(), UtilError> {
let file = std::fs::File::create(self.car.as_ref() as &Path).unwrap(); archive_local(self.source.as_ref() as &Path, file)?;
Ok(())
}
}