cpp/tests/poppler-dump.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+)
New commits: commit cc7a18307d363c687221a49cee3e0b6e22ff390f Author: Masamichi Hosoda <[email protected]> Date: Tue Feb 12 21:16:42 2019 +0900 cpp: tests: Add showing version information to poppler-dump diff --git a/cpp/tests/poppler-dump.cpp b/cpp/tests/poppler-dump.cpp index 2451be2e..cdd515d3 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_embedded_files = false; 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 @@ static const ArgDesc the_args[] = { "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 @@ int main(int argc, char *argv[]) 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()); } _______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
