aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-04-27 11:53:32 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-04-27 11:53:32 +0000
commitc21daf2037bd6b4e00094a3a7df4c865d562f0ff (patch)
tree0d6d4608af7f63c6f095389689ff1fa724bfac59
parent10992400975d6f6177e29fc85c1a884be5faa13c (diff)
downloadpaludis-c21daf2037bd6b4e00094a3a7df4c865d562f0ff.tar.gz
paludis-c21daf2037bd6b4e00094a3a7df4c865d562f0ff.tar.xz
Output wrapper tweaks
-rw-r--r--paludis/util/output_wrapper.cc7
-rwxr-xr-xtest/run_test.sh3
2 files changed, 7 insertions, 3 deletions
diff --git a/paludis/util/output_wrapper.cc b/paludis/util/output_wrapper.cc
index 9ea5889..3278085 100644
--- a/paludis/util/output_wrapper.cc
+++ b/paludis/util/output_wrapper.cc
@@ -31,6 +31,7 @@ main(int argc, char *argv[])
{
int argi(1);
std::string stdout_prefix, stderr_prefix;
+ bool wrap_blanks(false);
for ( ; argi < argc ; ++argi)
{
@@ -40,6 +41,8 @@ main(int argc, char *argv[])
++argi;
break;
}
+ else if (s == "--wrap-blanks")
+ wrap_blanks = true;
else if (s == "--stdout-prefix")
{
if (++argi >= argc)
@@ -152,7 +155,7 @@ main(int argc, char *argv[])
if (! stdout_prefix_shown)
{
- if (stdout_had_interesting_char)
+ if (stdout_had_interesting_char || wrap_blanks)
std::cout << stdout_prefix;
stdout_prefix_shown = true;
}
@@ -186,7 +189,7 @@ main(int argc, char *argv[])
if (! stderr_prefix_shown)
{
- if (stderr_had_interesting_char)
+ if (stderr_had_interesting_char || wrap_blanks)
std::cerr << stderr_prefix;
stderr_prefix_shown = true;
}
diff --git a/test/run_test.sh b/test/run_test.sh
index 52e1761..6e41a42 100755
--- a/test/run_test.sh
+++ b/test/run_test.sh
@@ -28,7 +28,8 @@ fi
echo ">>> test ${testname}"
if [[ -n "${TEST_OUTPUT_WRAPPER}" ]] ; then
- $TEST_OUTPUT_WRAPPER --stdout-prefix "${testname#./}> " --stderr-prefix "${testname#./}> " -- ${@}
+ $TEST_OUTPUT_WRAPPER --stdout-prefix "${testname#./}> " --stderr-prefix \
+ "${testname#./}> " --wrap-blanks -- ${@}
code=$?
else
${@}