From 09a5e93720955fd6b94874805ad0282cd5e6d971 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Wed, 21 Nov 2018 23:09:08 +0100 Subject: Add --version option to Inkview. --- src/inkview-application.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/inkview-application.cpp') diff --git a/src/inkview-application.cpp b/src/inkview-application.cpp index 1982ca454..3de20a8aa 100644 --- a/src/inkview-application.cpp +++ b/src/inkview-application.cpp @@ -21,6 +21,7 @@ #include "inkview-application.h" #include "inkscape.h" // Inkscape::Application +#include "inkscape-version.h" // Inkscape version #include "inkgc/gc-core.h" // Garbage Collecting init #include "inkview-window.h" @@ -58,6 +59,7 @@ InkviewApplication::InkviewApplication() // Will automatically handle character conversions. // Note: OPTION_TYPE_FILENAME => std::string, OPTION_TYPE_STRING => Glib::ustring. + add_main_option_entry(OPTION_TYPE_BOOL, "version", 'V', N_("Print: Inkview version."), ""); add_main_option_entry(OPTION_TYPE_BOOL, "fullscreen", 'f', N_("Launch in fullscreen mode"), ""); add_main_option_entry(OPTION_TYPE_BOOL, "recursive", 'r', N_("Search folders recursively"), ""); add_main_option_entry(OPTION_TYPE_INT, "timer", 't', N_("Change image every NUMBER seconds"), N_("NUMBER")); @@ -117,6 +119,11 @@ InkviewApplication::on_handle_local_options(const Glib::RefPtrcontains("version")) { + std::cout << "Inkscape " << Inkscape::version_string << std::endl; + return EXIT_SUCCESS; + } + if (options->contains("fullscreen")) { fullscreen = true; } -- cgit v1.2.3