aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index fef188e..7f88d32 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -20,7 +20,7 @@ use structs::*;
use clap::{App, Arg, SubCommand};
-const VERSION: &str = "0.5.1";
+const VERSION: &str = "0.5.2";
fn main() {
if let Err(err) = create_directories() {
@@ -60,11 +60,20 @@ fn main() {
),
)
.subcommand(
- SubCommand::with_name("play")
+ SubCommand::with_name("list")
.about("list episodes of podcast")
.arg(
Arg::with_name("PODCAST")
.help("Regex for subscribed podcast")
+ .index(1),
+ ),
+ )
+ .subcommand(
+ SubCommand::with_name("play")
+ .about("play an episode")
+ .arg(
+ Arg::with_name("PODCAST")
+ .help("Regex for subscribed podcast")
.required(true)
.index(1),
)
@@ -131,8 +140,11 @@ fn main() {
None => download_all(&state, podcast),
}
}
- Some("ls") => {
- let list_matches = matches.subcommand_matches("ls").unwrap();
+ Some("ls") | Some("list") => {
+ let list_matches = matches
+ .subcommand_matches("ls")
+ .or(matches.subcommand_matches("list"))
+ .unwrap();
match list_matches.value_of("PODCAST") {
Some(regex) => list_episodes(regex),
None => list_subscriptions(&state),