Skip to content

Commit

Permalink
rdmd: Use -d with --loop/--eval to silence std.stream warnings
Browse files Browse the repository at this point in the history
Fixes issue 15175
  • Loading branch information
CyberShadow committed Oct 7, 2015
1 parent df8e39d commit cf6139e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions rdmd.d
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,15 @@ int main(string[] args)
~ "foreach (line; std.stdio.stdin.byLine()) {\n"
~ std.string.join(loop, "\n")
~ ";\n} }");
argsBeforeProgram ~= "-d";
}
else if (eval.ptr)
{
enforce(programPos == args.length, "Cannot have both --eval and a " ~
"program file ('" ~ args[programPos] ~ "').");
root = makeEvalFile(importWorld ~ "void main(char[][] args) {\n"
~ std.string.join(eval, "\n") ~ ";\n}");
argsBeforeProgram ~= "-d";
}
else if (programPos < args.length)
{
Expand Down
2 changes: 1 addition & 1 deletion rdmd_test.d
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void runTests()
assert(res.status == 0, res.output); // --build-only should not interfere with --dry-run

/* Test --eval. */
res = execute([rdmdApp, compilerSwitch, "--force", "--eval=writeln(`eval_works`);"]);
res = execute([rdmdApp, compilerSwitch, "--force", "-de", "--eval=writeln(`eval_works`);"]);
assert(res.status == 0, res.output);
assert(res.output.canFind("eval_works")); // there could be a "DMD v2.xxx header in the output"

Expand Down

0 comments on commit cf6139e

Please sign in to comment.