feat: add report flag to CLI
This commit is contained in:
parent
e5c51fe995
commit
57086cab9a
1 changed files with 8 additions and 4 deletions
|
|
@ -19,6 +19,9 @@ use serde::Serialize;
|
||||||
struct Cli {
|
struct Cli {
|
||||||
#[clap(subcommand)]
|
#[clap(subcommand)]
|
||||||
command: Commands,
|
command: Commands,
|
||||||
|
/// Always generate a report (used for debugging)
|
||||||
|
#[clap(long)]
|
||||||
|
report: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Subcommand)]
|
#[derive(Subcommand)]
|
||||||
|
|
@ -392,10 +395,11 @@ async fn main() {
|
||||||
storage_dir.push("rustypipe");
|
storage_dir.push("rustypipe");
|
||||||
_ = std::fs::create_dir(&storage_dir);
|
_ = std::fs::create_dir(&storage_dir);
|
||||||
|
|
||||||
let rp = RustyPipe::builder()
|
let mut rp = RustyPipe::builder().storage_dir(storage_dir);
|
||||||
.storage_dir(storage_dir)
|
if cli.report {
|
||||||
.build()
|
rp = rp.report();
|
||||||
.unwrap();
|
}
|
||||||
|
let rp = rp.build().unwrap();
|
||||||
|
|
||||||
match cli.command {
|
match cli.command {
|
||||||
Commands::Download {
|
Commands::Download {
|
||||||
|
|
|
||||||
Reference in a new issue