parse Args for directory

This commit is contained in:
Paul Campbell 2023-08-05 18:07:00 +01:00
parent 536534bb04
commit fbcbb661ea
3 changed files with 14 additions and 0 deletions

View file

@ -5,6 +5,7 @@ pub mod feed;
pub mod file;
pub mod history;
pub mod network;
pub mod params;
pub mod prelude;
#[cfg(test)]

View file

@ -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,

9
src/params/mod.rs Normal file
View file

@ -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,
}