aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmd/stream.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-10-18 12:47:09 -0400
committerJesse Luehrs <doy@tozt.net>2019-10-18 12:59:35 -0400
commite5ccc1d13a82ec9b3bf86e61c045107b3171dfb2 (patch)
tree599866debbbfa453a3abce2df4d3278daa7e535e /src/cmd/stream.rs
parenta561217eca9f3076b097e6af3ee6cf229cf35668 (diff)
downloadteleterm-e5ccc1d13a82ec9b3bf86e61c045107b3171dfb2.tar.gz
teleterm-e5ccc1d13a82ec9b3bf86e61c045107b3171dfb2.zip
load config data from a file too
Diffstat (limited to 'src/cmd/stream.rs')
-rw-r--r--src/cmd/stream.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cmd/stream.rs b/src/cmd/stream.rs
index 2e1ea03..d52c410 100644
--- a/src/cmd/stream.rs
+++ b/src/cmd/stream.rs
@@ -172,8 +172,11 @@ pub fn cmd<'a, 'b>(app: clap::App<'a, 'b>) -> clap::App<'a, 'b> {
.arg(clap::Arg::with_name("args").index(2).multiple(true))
}
-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()
+ }))
}
struct StreamSession<