From 40bde9e765e8eab4ee694567e85a1ca845b8b815 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 21 Jun 2009 15:37:36 -0400 Subject: [PATCH] Enhancement - shadow files - Properly clears out the context, so shadow files can work. --- src/Context.cpp | 8 ++++---- src/tests/run_all | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Context.cpp b/src/Context.cpp index 0fd1a9908..a23c210ac 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -219,9 +219,8 @@ std::string Context::dispatch () else { out = shortUsage (); } // Only update the shadow file if such an update was not suppressed (shadow), -// TODO -// if (cmd.isWriteCommand (cmd.command) && !inShadow)) -// shadow (); + if (cmd.isWriteCommand () && !inShadow) + shadow (); return out; } @@ -252,6 +251,8 @@ void Context::shadow () config.set ("curses", "off"); config.set ("color", "off"); + clear (); + // Run report. Use shadow.command, using default.command as a fallback // with "list" as a default. std::string command = config.get ("shadow.command", @@ -261,7 +262,6 @@ void Context::shadow () initialize (); parse (); std::string result = dispatch (); - std::ofstream out (shadowFile.c_str ()); if (out.good ()) { diff --git a/src/tests/run_all b/src/tests/run_all index 9853f957f..7db04f15f 100755 --- a/src/tests/run_all +++ b/src/tests/run_all @@ -9,3 +9,9 @@ done date >> all.log +echo -n 'Pass: ' +grep ^ok all.log | wc -l + +echo -n 'Fail: ' +grep ^not all.log | wc -l +