From fbcbb661eabe3a9a871112e4d282b8f933067fc6 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 5 Aug 2023 18:07:00 +0100 Subject: [PATCH] parse Args for directory --- src/lib.rs | 1 + src/main.rs | 4 ++++ src/params/mod.rs | 9 +++++++++ 3 files changed, 14 insertions(+) create mode 100644 src/params/mod.rs diff --git a/src/lib.rs b/src/lib.rs index d59f443..abf5ed9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,6 +5,7 @@ pub mod feed; pub mod file; pub mod history; pub mod network; +pub mod params; pub mod prelude; #[cfg(test)] diff --git a/src/main.rs b/src/main.rs index c1c31ca..5d830ab 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,7 @@ +use clap::Parser; use podal::file::FileEnv; use podal::network::NetworkEnv; +use podal::params::Args; use podal::prelude::*; fn main() -> Result<()> { @@ -8,6 +10,8 @@ fn main() -> Result<()> { let history = "downloaded.txt"; let site = "https://www.youtube.com/"; + let args = Args::parse(); + podal::run( subscriptions, history, diff --git a/src/params/mod.rs b/src/params/mod.rs new file mode 100644 index 0000000..53c561b --- /dev/null +++ b/src/params/mod.rs @@ -0,0 +1,9 @@ +use clap::Parser; + +#[derive(Parser, Debug)] +pub struct Args { + /// The directory to download mp3 files into + /// Defaults to the current directory + #[arg(short, long)] + pub directory: String, +}