-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepared the project to be usable with both CLI and GUI by exposing common API functions in lib.rs
- Loading branch information
1 parent
0871529
commit bf3aba2
Showing
13 changed files
with
237 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use std::{io, time::Instant}; | ||
use lockbox::{cli, log_fatal, log_success}; | ||
|
||
fn main() -> io::Result<()> { | ||
let start_time = Instant::now(); | ||
let args = cli::get_command().get_matches(); | ||
|
||
cli::logger::configure_logger(&args); | ||
|
||
/* BOX */ | ||
if let Some(args) = args.subcommand_matches("box") { | ||
match cli::commands::r#box(args) { | ||
Ok(file_count) => log_success!("Total files encrypted: {}", file_count), | ||
Err(err) => log_fatal!("Encryption failed: {}", err) | ||
} | ||
} | ||
|
||
/* UNBOX */ | ||
if let Some(args) = args.subcommand_matches("unbox") { | ||
match cli::commands::unbox(args) { | ||
Ok(file_count) => log_success!("Total files decrypted: {}", file_count), | ||
Err(err) => log_fatal!("Decryption failed: {}", err) | ||
} | ||
} | ||
|
||
/* KEY */ | ||
if let Some(args) = args.subcommand_matches("key") { | ||
cli::commands::key(args) | ||
} | ||
|
||
let duration = start_time.elapsed(); | ||
log_success!("Time taken: {:.2?}", duration); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.