Philipp Hörist pushed to branch master at gajim / gajim
Commits:
d20f2201 by Philipp Hörist at 2017-08-18T17:48:03+02:00
Print error on unhandled commandline arguments
- - - - -
1 changed file:
- gajim/gajim.py
Changes:
=====================================
gajim/gajim.py
=====================================
--- a/gajim/gajim.py
+++ b/gajim/gajim.py
@@ -97,6 +97,9 @@ class GajimApplication(Gtk.Application):
self.add_main_option('warnings', ord('w'), GLib.OptionFlags.NONE,
GLib.OptionArg.NONE,
_('Show all warnings'))
+ self.add_main_option(GLib.OPTION_REMAINING, 0, GLib.OptionFlags.HIDDEN,
+ GLib.OptionArg.STRING_ARRAY,
+ "")
self.profile = ''
self.config_path = None
@@ -292,6 +295,10 @@ class GajimApplication(Gtk.Application):
logging_helpers.set_loglevels(loglevel)
if options.contains('warnings'):
self.show_warnings()
+ if options.contains(GLib.OPTION_REMAINING):
+ unhandled = options.lookup_value(GLib.OPTION_REMAINING).get_strv()
+ print('Error: Unhandled arguments: %s' % unhandled)
+ return 0
return -1
def do_command_line(self, command_line: Gio.ApplicationCommandLine) -> int:
View it on GitLab:
https://dev.gajim.org/gajim/gajim/commit/d20f2201f2c020cf092f41d29a9c6645034ba773
---
View it on GitLab:
https://dev.gajim.org/gajim/gajim/commit/d20f2201f2c020cf092f41d29a9c6645034ba773
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits