cpp: tests: Add showing version information to poppler-dump
diff --git a/cpp/tests/poppler-dump.cpp b/cpp/tests/poppler-dump.cpp
index 2451be2..cdd515d 100644
--- a/cpp/tests/poppler-dump.cpp
+++ b/cpp/tests/poppler-dump.cpp
@@ -27,6 +27,7 @@
 #include <poppler-font.h>
 #include <poppler-page.h>
 #include <poppler-toc.h>
+#include <poppler-version.h>
 
 #include <cstdlib>
 #include <cstring>
@@ -55,6 +56,7 @@
 bool show_pages = false;
 bool show_destinations = false;
 bool show_help = false;
+bool show_version = false;
 char show_text[32];
 bool show_text_list = false;
 poppler::page::text_layout_enum show_text_layout = poppler::page::physical_layout;
@@ -86,6 +88,8 @@
       "print usage information" },
     { "--help",                argFlag,  &show_help,           0,
       "print usage information" },
+    { "--version",             argFlag,  &show_version,        0,
+      "print poppler version" },
     { nullptr, argFlag, nullptr, 0, nullptr }
 };
 
@@ -474,6 +478,12 @@
         show_pages = true;
     }
 
+    if (show_version) {
+        std::cout << std::setw(out_width) << "Compiled" << ": poppler-cpp "
+                  << POPPLER_VERSION << std::endl
+                  << std::setw(out_width) << "Running" << ": poppler-cpp "
+                  << poppler::version_string() << std::endl;
+    }
     if (show_info) {
         print_info(doc.get());
     }