Print error on unhandled commandline arguments
This commit is contained in:
parent
43fbcbf8cf
commit
d20f2201f2
|
@ -97,6 +97,9 @@ class GajimApplication(Gtk.Application):
|
||||||
self.add_main_option('warnings', ord('w'), GLib.OptionFlags.NONE,
|
self.add_main_option('warnings', ord('w'), GLib.OptionFlags.NONE,
|
||||||
GLib.OptionArg.NONE,
|
GLib.OptionArg.NONE,
|
||||||
_('Show all warnings'))
|
_('Show all warnings'))
|
||||||
|
self.add_main_option(GLib.OPTION_REMAINING, 0, GLib.OptionFlags.HIDDEN,
|
||||||
|
GLib.OptionArg.STRING_ARRAY,
|
||||||
|
"")
|
||||||
|
|
||||||
self.profile = ''
|
self.profile = ''
|
||||||
self.config_path = None
|
self.config_path = None
|
||||||
|
@ -292,6 +295,10 @@ class GajimApplication(Gtk.Application):
|
||||||
logging_helpers.set_loglevels(loglevel)
|
logging_helpers.set_loglevels(loglevel)
|
||||||
if options.contains('warnings'):
|
if options.contains('warnings'):
|
||||||
self.show_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
|
return -1
|
||||||
|
|
||||||
def do_command_line(self, command_line: Gio.ApplicationCommandLine) -> int:
|
def do_command_line(self, command_line: Gio.ApplicationCommandLine) -> int:
|
||||||
|
|
Loading…
Reference in New Issue