Handle version option in Gtk.Application

This commit is contained in:
Philipp Hörist 2017-02-11 21:09:31 +01:00
parent f9269d5ce0
commit 4bf65a4039
2 changed files with 4 additions and 5 deletions

View File

@ -229,6 +229,10 @@ class GajimApplication(Gtk.Application):
self.profile_separation = True
if options.contains('config-path'):
self.config_path = options.lookup_value('config-path').get_string()
if options.contains('version'):
from common.defs import version
print(version)
return 0
return -1
def do_command_line(self, command_line: Gio.ApplicationCommandLine) -> int:

View File

@ -37,11 +37,6 @@
import sys
if '--version' in sys.argv or '-V' in sys.argv:
from common.defs import version
print(version)
sys.exit(0)
# Test here for all required versions so we dont have to
# test multiple times in every module. nbxmpp also needs GLib.
import gi