Handle version option in Gtk.Application
This commit is contained in:
parent
f9269d5ce0
commit
4bf65a4039
|
@ -229,6 +229,10 @@ class GajimApplication(Gtk.Application):
|
||||||
self.profile_separation = True
|
self.profile_separation = True
|
||||||
if options.contains('config-path'):
|
if options.contains('config-path'):
|
||||||
self.config_path = options.lookup_value('config-path').get_string()
|
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
|
return -1
|
||||||
|
|
||||||
def do_command_line(self, command_line: Gio.ApplicationCommandLine) -> int:
|
def do_command_line(self, command_line: Gio.ApplicationCommandLine) -> int:
|
||||||
|
|
|
@ -37,11 +37,6 @@
|
||||||
|
|
||||||
import sys
|
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 here for all required versions so we dont have to
|
||||||
# test multiple times in every module. nbxmpp also needs GLib.
|
# test multiple times in every module. nbxmpp also needs GLib.
|
||||||
import gi
|
import gi
|
||||||
|
|
Loading…
Reference in New Issue