summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/config.rs2
-rw-r--r--src/main.rs4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/config.rs b/src/config.rs
index c0e4df8..b44445b 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -4,6 +4,8 @@ use serde::Deserialize;
#[derive(Deserialize)]
pub struct Config {
+ #[serde(default)]
+ pub urls: Vec<String>
}
pub fn default_config_file_locations() -> Vec<String> {
diff --git a/src/main.rs b/src/main.rs
index e56726a..b7d5a4b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -14,11 +14,11 @@ struct Args {
fn main() {
let args = Args::parse();
- let _config = match args.config_file.as_str() {
+ 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!("Found config file.");
+ println!("URLs to fetch: {:#?}", config.urls);
}