play status with corresponding commands

This commit is contained in:
Aaron Manning
2024-11-18 21:44:36 +11:00
parent e6129fa5b6
commit 105a3eb892
3 changed files with 122 additions and 23 deletions

View File

@@ -6,9 +6,42 @@ pub (crate) struct Args {
/// Path to the configuration file listing podcast RSS feeds.
#[arg(default_value = "./podcasts.toml")]
pub (crate) config : path::PathBuf,
/// The podcast to update. Updates all in configuration file if unspecified.
#[arg(long, short)]
pub (crate) podcast : Option<String>,
#[command(subcommand)]
pub (crate) command : Command,
}
#[derive(clap::ValueEnum, Copy, Clone, Debug,PartialEq, Eq, PartialOrd, Ord)]
pub (crate) enum ListenStatus {
Listened,
Unlistened,
}
#[derive(clap::Subcommand)]
pub (crate) enum Command {
/// Updates feed and downloads latest episodes.
Download {
/// The podcast to update. Updates all in configuration file if unspecified.
#[arg(long, short)]
podcast : Option<String>,
},
/// Lists the episodes for a given podcast, filtered based on if it has been listened or not.
List {
/// Filter for if episodes have been listened to or not.
#[arg(long, short)]
status : Option<ListenStatus>,
/// The podcast to list episodes for.
#[arg(long, short)]
podcast : String,
},
/// Marks an entire podcast's history of episodes as played or unplayed.
Mark {
/// The new listen status for the episodes.
#[arg(long, short)]
status : ListenStatus,
/// The podcast to change the listen status of.
#[arg(long, short)]
podcast : String,
},
}
/// Struct modelling configuration file format.