Skip to content

Commit

Permalink
Only print to stdout when asked
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuukk authored Oct 12, 2024
1 parent 796d212 commit c9d2fad
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/dscanner/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ else

if (help)
{
printHelp(args[0]);
printHelp(args[0], true);
return 0;
}

Expand Down Expand Up @@ -250,7 +250,7 @@ else
}
else if (optionCount < 1)
{
printHelp(args[0]);
printHelp(args[0], false);
return 1;
}

Expand Down Expand Up @@ -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 <options>
Human-readable output:
Expand Down

0 comments on commit c9d2fad

Please sign in to comment.