From 57086cab9ad7c31ec68d94e4f63b39a37d3b6d11 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Thu, 3 Aug 2023 20:49:30 +0200 Subject: [PATCH] feat: add report flag to CLI --- cli/src/main.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index c96cd98..ff53c77 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -19,6 +19,9 @@ use serde::Serialize; struct Cli { #[clap(subcommand)] command: Commands, + /// Always generate a report (used for debugging) + #[clap(long)] + report: bool, } #[derive(Subcommand)] @@ -392,10 +395,11 @@ async fn main() { storage_dir.push("rustypipe"); _ = std::fs::create_dir(&storage_dir); - let rp = RustyPipe::builder() - .storage_dir(storage_dir) - .build() - .unwrap(); + let mut rp = RustyPipe::builder().storage_dir(storage_dir); + if cli.report { + rp = rp.report(); + } + let rp = rp.build().unwrap(); match cli.command { Commands::Download {