diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-10-20 13:55:28 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-10-20 13:59:35 -0400 |
commit | ca7de0c239091b6c3d71e1863baf885754d4dc54 (patch) | |
tree | ee7898ce7401f8c3c4d6a410e04a1013bdb1eac5 /src/cmd/stream.rs | |
parent | 4d8684f14658e404e25bac8235340129920e5017 (diff) | |
download | teleterm-ca7de0c239091b6c3d71e1863baf885754d4dc54.tar.gz teleterm-ca7de0c239091b6c3d71e1863baf885754d4dc54.zip |
make running with no config file work again
Diffstat (limited to 'src/cmd/stream.rs')
-rw-r--r-- | src/cmd/stream.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/cmd/stream.rs b/src/cmd/stream.rs index 44f09d7..9555f47 100644 --- a/src/cmd/stream.rs +++ b/src/cmd/stream.rs @@ -95,11 +95,15 @@ pub fn cmd<'a, 'b>(app: clap::App<'a, 'b>) -> clap::App<'a, 'b> { } pub fn config( - config: config::Config, + config: Option<config::Config>, ) -> Result<Box<dyn crate::config::Config>> { - let config: Config = config - .try_into() - .context(crate::error::CouldntParseConfig)?; + let config: Config = if let Some(config) = config { + config + .try_into() + .context(crate::error::CouldntParseConfig)? + } else { + Config::default() + }; Ok(Box::new(config)) } |