commit 13f1ac5aba8bbb3030068acf565c0773811e0e6b
Author: David Sorber <david.sorber@gmail.com>
Date:   Wed Sep 12 17:58:33 2018 -0400

    Minor formatting changes for running status output.

diff --git a/software/photo_compress_archiver/PhotoCompressArchiver.cc b/software/photo_compress_archiver/PhotoCompressArchiver.cc
index ead8caf..4b15f60 100644
--- a/software/photo_compress_archiver/PhotoCompressArchiver.cc
+++ b/software/photo_compress_archiver/PhotoCompressArchiver.cc
@@ -6,6 +6,7 @@
 #include <iostream>
 #include <limits.h>
 #include <thread>
+#include <sstream>
 #include <sys/stat.h>
 #include <sys/wait.h>
 #include <unistd.h>
@@ -168,8 +169,7 @@ int PhotoCompressArchiver::execute()
     
     // Display status
     std::cout << BOLD << "\n>>> Status:" << ENDC << std::endl;
-    std::string line(100, '-');
-    std::cout << line << std::endl;
+    std::cout << LINE << std::endl;
     if (! m_verbose)
     {
         // If not in verbose mode display running status
@@ -187,15 +187,32 @@ int PhotoCompressArchiver::execute()
             
             double ratio = ((double)m_total_compressed_size / 
                             m_running_compressed_size) * 100;
-                            
+            // This looks odd but in fact checks for NaN which we don't want to
+            // display in the status
+            if (ratio != ratio)
+            {
+                ratio = 0.0;
+            }
+            
+            // Highlight and non-zero number of errors in bold red for emphasis
             uint32_t num_errors = m_errors.size();
+            std::ostringstream formatted_errors;
+            if (num_errors > 0)
+            {
+                formatted_errors << "Errors: " << BOLD << RED << num_errors 
+                                 << ENDC;
+            }
+            else
+            {
+                formatted_errors << "Errors: " << num_errors ;
+            }
             
             std::cout << "Elapsed time: " << std::fixed 
                       << std::setprecision(3) << duration << " s     "
                       << "Files processed: " 
                       << m_files_processed << " / " 
                       << m_num_input_files << "     " 
-                      << "Errors: " << num_errors << "          "
+                      << formatted_errors.str() << "               "
                       << std::endl;
                       
             pbar.update(std::lround(percent_done));
@@ -207,9 +224,9 @@ int PhotoCompressArchiver::execute()
                       << std::setprecision(2) << ratio << "%               "
                       << std::endl;
                       
-            std::cout << line << std::endl;
+            std::cout << LINE << std::endl;
 
-            // Delay slightly to prevent flickering 
+            // Delay slightly to prevent cursor flickering 
             if (percent_done < 100.0)
             {
                 std::this_thread::sleep_for(std::chrono::milliseconds(100));
diff --git a/software/photo_compress_archiver/PhotoCompressArchiver.hh b/software/photo_compress_archiver/PhotoCompressArchiver.hh
index 5cc7b8a..daa6134 100644
--- a/software/photo_compress_archiver/PhotoCompressArchiver.hh
+++ b/software/photo_compress_archiver/PhotoCompressArchiver.hh
@@ -26,7 +26,7 @@ const std::string PURPLE("\033[35m");
 const std::string UP_ONE = "\033[1A";
 const std::string DOWN_ONE = "\033[1B";
 
-const std::string version("v0.3.5");
+const std::string version("v0.4.1");
 
 const boost::regex JPEG_REGEX("^.+\\.(jpg)|(jpeg)$", boost::regex::icase);
 const boost::regex PJG_REGEX("^.+\\.pjg$", boost::regex::icase);
@@ -35,6 +35,7 @@ const std::string JPG_EXTENSION(".jpg");
 const std::string PJG_EXTENSION(".pjg");
 
 const uint32_t PROGRESS_BAR_WIDTH = 80;
+const std::string LINE(100, '-');
 
 class WorkUnit
 {
@@ -99,7 +100,7 @@ class PhotoCompressArchiver
         uint32_t m_num_threads;             // number of processing threads to use
         bool m_decompress;                  // decompress files instead of compress them
         bool m_delete_orig;                 // delete original files after de/compression
-        bool m_verbose ;                    // verbose processing output
+        bool m_verbose;                     // verbose processing output
         
         std::mutex m_output_mutex;          // output mutex
         
