aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmd/watch.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/watch.rs')
-rw-r--r--src/cmd/watch.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/cmd/watch.rs b/src/cmd/watch.rs
index d63cf13..6806a0e 100644
--- a/src/cmd/watch.rs
+++ b/src/cmd/watch.rs
@@ -87,11 +87,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))
}