diff options
| author | Joe Carstairs <me@joeac.net> | 2026-09-05 07:05:45 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-09-05 07:28:31 +0100 |
| commit | 423f5c455e1ed3586f3edf2cd81cd62bd5f91a63 (patch) | |
| tree | 8220d2bbf49d64c903155444e9f301cc27d6eb35 /src/main.rs | |
| parent | 7101e73d22563f0ea0d0402179e8a3746e9278cc (diff) | |
retrieves rss feeds
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index b7d5a4b..ae68477 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,8 +1,10 @@ mod config; +mod retrieve; use clap::Parser; +use futures::executor::block_on; -use crate::config::Config; +use crate::{config::Config, retrieve::retrieve}; #[derive(Parser, Debug)] #[command(version, about, long_about = None)] @@ -14,11 +16,17 @@ struct Args { fn main() { let args = Args::parse(); + let config = match args.config_file.as_str() { "" => Config::find_config().unwrap_or_else(|| panic!("Failed to find config. Paths searched: {:#?}", config::default_config_file_locations())), path => Config::parse_config_file_at_path(&path).unwrap_or_else(|err| panic!("Failed to parse config at {}. Error: {}", path, err)), }; - println!("URLs to fetch: {:#?}", config.urls); + + block_on(async { + for channel in retrieve(config.urls.iter().map(AsRef::as_ref)).await { + println!("{:#?}", channel); + } + }); } |
