diff --git a/src/old.rs b/src/old.rs index 8562712..620ca5b 100644 --- a/src/old.rs +++ b/src/old.rs @@ -72,12 +72,14 @@ pub fn time_or_warning(time: DateTime, db: &D) -> Result<(Date /// emits the appropiate warning if the old database format was detected. pub fn warn_if_needed(err: &mut E, needs_warning: bool) -> Result<()> { if needs_warning { - writeln!( - err, - "{} You are using the old timetrap format, it is advised that \ - you update your database using t migrate", - Yellow.bold().paint("[WARNING]"), - ).map_err(|e| IOError(e))?; + if std::env::var_os("TIEMPO_SUPRESS_TIMETRAP_WARNING").is_none() { + writeln!( + err, + "{} You are using the old timetrap format, it is advised that \ + you update your database using t migrate", + Yellow.bold().paint("[WARNING]"), + ).map_err(|e| IOError(e))?; + } } Ok(())