use clap::Parser;
use encrypted_archive::archive;
use encrypted_archive::cli::{Cli, Commands};

fn main() -> anyhow::Result<()> {
    let cli = Cli::parse();

    match cli.command {
        Commands::Pack {
            files,
            output,
            no_compress,
        } => {
            archive::pack(&files, &output, &no_compress)?;
        }
        Commands::Unpack {
            archive,
            output_dir,
        } => {
            archive::unpack(&archive, &output_dir)?;
        }
        Commands::Inspect { archive } => {
            archive::inspect(&archive)?;
        }
    }

    Ok(())
}
