From 604f2a641b78377e471fac65204ded5c35c607e3 Mon Sep 17 00:00:00 2001 From: sigil-03 Date: Tue, 30 Apr 2024 09:00:53 -0600 Subject: [PATCH] add `print-immediately` flag to load command --- Cargo.toml | 2 +- src/main.rs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5de8537..c34a779 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,4 +12,4 @@ serde = { version = "1.0.197", features = ["derive"] } serde_json = "1.0.114" thiserror = "1.0.58" toml = "0.8.11" -uuid = { version = "1.8.0", features = ["v8"] } +uuid = { version = "1.8.0", features = ["v4"] } diff --git a/src/main.rs b/src/main.rs index afdd0e7..fa84233 100644 --- a/src/main.rs +++ b/src/main.rs @@ -230,6 +230,8 @@ enum Command { Info, Load { filepath: String, + #[arg(long)] + print_immediately: bool, }, Print { file_id: Uuid, @@ -275,8 +277,11 @@ fn main() -> Result<(), Error> { prusa.print_storage_info()?; }, // Should generate UUID for the filename: - Command::Load {filepath} => { + Command::Load {filepath, print_immediately} => { let uuid = prusa.try_load_file(&filepath)?; + if print_immediately { + prusa.try_print_file(&uuid)?; + } println!("Loaded as UUID:\n{uuid}"); }, Command::Print {file_id} => prusa.try_print_file(&file_id)?,