From a45c19647f8c14663a3555d266fd6208d619439a Mon Sep 17 00:00:00 2001 From: michaeldel Date: Thu, 16 Apr 2020 21:42:02 +0200 Subject: [PATCH] Move cache age warning to stderr (#114) Fixes #113 --- src/main.rs | 2 +- tests/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 77fd4e4d..38f646ee 100644 --- a/src/main.rs +++ b/src/main.rs @@ -180,7 +180,7 @@ fn check_cache(args: &Args) { if args.flag_quiet { return; } - println!( + eprintln!( "{}", Color::Yellow.paint(format!( "The cache hasn't been updated for more than {} days.\n\ diff --git a/tests/lib.rs b/tests/lib.rs index 3fc35ba4..810c9ece 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -165,14 +165,14 @@ fn test_quiet_old_cache() { .args(&["tldr"]) .assert() .success() - .stdout(contains("The cache hasn't been updated for more than ")); + .stderr(contains("The cache hasn't been updated for more than ")); testenv .command() .args(&["tldr", "--quiet"]) .assert() .success() - .stdout(contains("The cache hasn't been updated for more than ").not()); + .stderr(contains("The cache hasn't been updated for more than ").not()); } #[test]