aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNathan Jaremko2019-02-24 18:11:04 -0500
committerNathan Jaremko2019-02-24 18:11:04 -0500
commit23b4500614a73140b023ad819b14bd90781d58ac (patch)
treef1f90f8a8f7c56ec6906ace5ea242332aa9ded19 /src
parent22e617eec8e2d8da36788ae40fb53c2ed2ebe734 (diff)
downloadpodcast-23b4500614a73140b023ad819b14bd90781d58ac.tar.bz2
Fix sub command
Diffstat (limited to 'src')
-rw-r--r--src/main.rs2
-rw-r--r--src/match_handler.rs3
-rw-r--r--src/structs.rs12
3 files changed, 3 insertions, 14 deletions
diff --git a/src/main.rs b/src/main.rs
index 2e312e7..8be9e82 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -30,7 +30,7 @@ pub mod errors {
use self::errors::*;
use self::structs::*;
-const VERSION: &str = "0.8.0";
+const VERSION: &str = "0.8.1";
fn main() -> Result<()> {
utils::create_directories().chain_err(|| "unable to create directories")?;
diff --git a/src/match_handler.rs b/src/match_handler.rs
index 3fd7c6a..599e8f1 100644
--- a/src/match_handler.rs
+++ b/src/match_handler.rs
@@ -66,7 +66,8 @@ pub fn handle_matches(
}
Some("sub") | Some("subscribe") => {
let subscribe_matches = matches
- .subcommand_matches("subscribe")
+ .subcommand_matches("sub")
+ .or_else(|| matches.subcommand_matches("subscribe"))
.chain_err(|| "unable to find subcommand matches")?;
let url = subscribe_matches
.value_of("URL")
diff --git a/src/structs.rs b/src/structs.rs
index 56c1674..d6bad40 100644
--- a/src/structs.rs
+++ b/src/structs.rs
@@ -211,18 +211,6 @@ impl Podcast {
))
}
- pub fn delete(title: &str) -> Result<()> {
- let mut path = get_xml_dir()?;
- let mut filename = String::from(title);
- filename.push_str(".xml");
- path.push(filename);
- fs::remove_file(path).chain_err(|| UNABLE_TO_REMOVE_FILE)
- }
-
- pub fn delete_all() -> Result<()> {
- fs::remove_dir_all(get_xml_dir()?).chain_err(|| UNABLE_TO_READ_DIRECTORY)
- }
-
pub fn episodes(&self) -> Vec<Episode> {
let mut result = Vec::new();
for item in self.0.items().to_owned() {