diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2018-11-21 22:09:08 +0000 |
|---|---|---|
| committer | Tavmjong Bah <tavmjong@free.fr> | 2018-11-21 22:09:08 +0000 |
| commit | 09a5e93720955fd6b94874805ad0282cd5e6d971 (patch) | |
| tree | 902e30fe1c747987b326266ffc88f5393ebfedf7 /src | |
| parent | -Werror=format-security: g_warning(_("...")) (diff) | |
| download | inkscape-09a5e93720955fd6b94874805ad0282cd5e6d971.tar.gz inkscape-09a5e93720955fd6b94874805ad0282cd5e6d971.zip | |
Add --version option to Inkview.
Diffstat (limited to 'src')
| -rw-r--r-- | src/inkview-application.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
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::RefPtr<Glib::VariantDict return -1; // Keep going } + if (options->contains("version")) { + std::cout << "Inkscape " << Inkscape::version_string << std::endl; + return EXIT_SUCCESS; + } + if (options->contains("fullscreen")) { fullscreen = true; } |
