aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmd/play.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/play.rs')
-rw-r--r--src/cmd/play.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cmd/play.rs b/src/cmd/play.rs
index a5fd534..bc8a214 100644
--- a/src/cmd/play.rs
+++ b/src/cmd/play.rs
@@ -43,8 +43,11 @@ pub fn cmd<'a, 'b>(app: clap::App<'a, 'b>) -> clap::App<'a, 'b> {
)
}
-pub fn config() -> Box<dyn crate::config::Config> {
- Box::new(Config::default())
+pub fn config(config: config::Config) -> Box<dyn crate::config::Config> {
+ Box::new(config.try_into().unwrap_or_else(|e| {
+ log::warn!("failed to parse config data: {}", e);
+ Config::default()
+ }))
}
#[allow(clippy::large_enum_variant)]