From c9d2fadc24e31fd3ee31fd3bf5f116ab462c3921 Mon Sep 17 00:00:00 2001 From: ryuukk <44361234+ryuukk@users.noreply.github.com> Date: Sat, 12 Oct 2024 17:21:20 +0200 Subject: [PATCH] Only print to stdout when asked --- src/dscanner/main.d | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/dscanner/main.d b/src/dscanner/main.d index b501ae9c..f3613460 100644 --- a/src/dscanner/main.d +++ b/src/dscanner/main.d @@ -168,7 +168,7 @@ else if (help) { - printHelp(args[0]); + printHelp(args[0], true); return 0; } @@ -250,7 +250,7 @@ else } else if (optionCount < 1) { - printHelp(args[0]); + printHelp(args[0], false); return 1; } @@ -416,9 +416,10 @@ else return 0; } -void printHelp(string programName) +void printHelp(string programName, bool stdOut) { - stdout.writefln(` + auto f = stdOut ? stdout : stderr; + f.writefln(` Usage: %1$s Human-readable output: