- Create src/lib.rs re-exporting all modules as public - Update main.rs to use encrypted_archive:: imports instead of local mod declarations - Add dev-dependencies: tempfile, assert_cmd, hex-literal, predicates
29 lines
620 B
Rust
29 lines
620 B
Rust
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(())
|
|
}
|