mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
gdbus-tool: Ignore unknown options for the 'emit' subcommand when completing
When completing, we parse the options that the user has typed so far. Up until now we've been doing this without ignoring unknown options. This leads to broken completions when the user has typed an incomplete parameter. For example, when doing the following: $ gdbus emit --session --obj<tab> We expect --object-path to be completed, but it is currently not. What happens is that we fail to parse the options, therefore don't act on --session and so don't connect to the session bus, then we early-exit because we need to know which bus to operate on for later completions. Instead we can ignore the half-completed --obj, parse --session, get connected to the bus and then move on to the later completion code. https://bugzilla.gnome.org/show_bug.cgi?id=793597
This commit is contained in:
parent
03e86d000f
commit
1717a8c965
@ -583,6 +583,8 @@ handle_emit (gint *argc,
|
||||
modify_argv0_for_command (argc, argv, "emit");
|
||||
|
||||
o = g_option_context_new (NULL);
|
||||
if (request_completion)
|
||||
g_option_context_set_ignore_unknown_options (o, TRUE);
|
||||
g_option_context_set_help_enabled (o, FALSE);
|
||||
g_option_context_set_summary (o, _("Emit a signal."));
|
||||
g_option_context_add_main_entries (o, emit_entries, GETTEXT_PACKAGE);
|
||||
|
Loading…
Reference in New Issue
Block a user