diff options
-rw-r--r-- | src/main.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 55bd637..cc1bb78 100644 --- a/src/main.rs +++ b/src/main.rs @@ -78,7 +78,7 @@ fn main() { fn inner_main(opts: &Opts) -> Result<()> { let config = config::load(&opts.config).context("Could not load configuration")?; - sanity_check(&config)?; + sanity_check(&config, opts)?; match &opts.subcmd { SubCommand::Watch(w) => watch(w, &config)?, @@ -250,7 +250,17 @@ fn upload_log(file: &Path) -> Result<String> { Ok(resp.permalink) } -fn sanity_check(config: &Config) -> Result<()> { +fn sanity_check(config: &Config, opts: &Opts) -> Result<()> { + if matches!(opts.subcmd, SubCommand::Watch(_)) + && config.discord.is_none() + && config.matrix.is_none() + && config.upload + { + warn!( + "You are uploading logs but not posting them anywhere. \ + Consider setting `upload = false` in your settings." + ); + } if config.discord.is_some() && !cfg!(feature = "im-discord") { bail!( "Discord is configured but ezau was built without Discord support. \ |