From 3e50b6c08aa1d0c78faca27cfbe0e32b276cdfd2 Mon Sep 17 00:00:00 2001 From: Yoshi Tacke <{"message":"Not Found","documentation_url":"https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user","status":"404"}130984990+YoshKoz@users.noreply.github.com> Date: Sun, 19 Apr 2026 23:24:46 +0200 Subject: [PATCH] fix: fully respect --quiet flag and route tip messages to stderr Two related issues: 1. The "cache not found" tip block after an error used `println!`, sending instructional text to stdout. This caused the output to appear inline in shell completion scripts (e.g. `tldr t` in bash/fish). Changed to `eprintln!` so all diagnostic output goes to stderr. 2. The deprecation warning for old custom-pages naming convention was not gated by `--quiet`, so it printed even when the user requested silence. Added `!args.quiet` guard to match all other warning sites. Fixes #268 --- src/main.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main.rs b/src/main.rs index 29dad95..efd45cd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -364,14 +364,14 @@ fn try_main(args: Cli, enable_styles: bool) -> Result { "Page cache not found. Please run `tldr --update` to download the cache." ), ); - println!("\nNote: You can optionally enable automatic cache updates by adding the"); - println!("following config to your config file:\n"); - println!(" [updates]"); - println!(" auto_update = true\n"); - println!("The path to your config file can be looked up with `tldr --show-paths`."); - println!("To create an initial config file, use `tldr --seed-config`.\n"); - println!("You can find more tips and tricks in our docs:\n"); - println!(" https://tealdeer-rs.github.io/tealdeer/config_updates.html"); + eprintln!("\nNote: You can optionally enable automatic cache updates by adding the"); + eprintln!("following config to your config file:\n"); + eprintln!(" [updates]"); + eprintln!(" auto_update = true\n"); + eprintln!("The path to your config file can be looked up with `tldr --show-paths`."); + eprintln!("To create an initial config file, use `tldr --seed-config`.\n"); + eprintln!("You can find more tips and tricks in our docs:\n"); + eprintln!(" https://tealdeer-rs.github.io/tealdeer/config_updates.html"); return Ok(ExitCode::FAILURE); }; @@ -405,7 +405,7 @@ fn try_main(args: Cli, enable_styles: bool) -> Result { // Show command from cache if !command.is_empty() { // TODO: Remove this check 1 year after version 1.7.0 was released - if cache.old_custom_pages_exist()? { + if !args.quiet && cache.old_custom_pages_exist()? { print_warning( enable_styles, &format!(