From e2d98849587df03c24bea4a10c243b29ace3347d Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Wed, 21 Feb 2018 12:23:17 +0000 Subject: [PATCH] gdbus-tool: Don't repeatedly complete --signal In this situation: $ gdbus emit --session --object-path /org/foo/bar --sig We will currently insert --signal three times. We should only do that once. https://bugzilla.gnome.org/show_bug.cgi?id=793597 --- gio/gdbus-tool.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gio/gdbus-tool.c b/gio/gdbus-tool.c index d8f098bb1..a4275984e 100644 --- a/gio/gdbus-tool.c +++ b/gio/gdbus-tool.c @@ -715,10 +715,17 @@ handle_emit (gint *argc, } if (opt_emit_signal == NULL) { + /* don't keep repeatedly completing --signal */ if (request_completion) - g_print ("--signal \n"); + { + if (g_strcmp0 ("--signal", completion_prev) != 0) + g_print ("--signal \n"); + } else - g_printerr (_("Error: Signal name is not specified\n")); + { + g_printerr (_("Error: Signal name is not specified\n")); + } + goto out; } if (request_completion && opt_emit_dest != NULL && opt_emit_object_path != NULL &&