From 0eda58a6e59f479c788e05cc781b2a178d6ff8c0 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 5 Oct 2009 14:45:47 -0400 Subject: Checking the dbusname and object to ensure that we get them. --- tools/dbusmenu-dumper.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tools') diff --git a/tools/dbusmenu-dumper.c b/tools/dbusmenu-dumper.c index 753c682..ed3b4b3 100644 --- a/tools/dbusmenu-dumper.c +++ b/tools/dbusmenu-dumper.c @@ -52,6 +52,13 @@ option_dbusobject (const gchar * arg, const gchar * value, gpointer data, GError return TRUE; } +void +usage (void) +{ + g_print("dbusmenu-dumper --dbus-name= --dbus-object=\n"); + return; +} + static GOptionEntry general_options[] = { {"dbus-name", 'd', 0, G_OPTION_ARG_CALLBACK, option_dbusname, "The name of the program to connect to (i.e. org.test.bob", "dbusname"}, {"dbus-object", 'o', 0, G_OPTION_ARG_CALLBACK, option_dbusobject, "The path to the Dbus object (i.e /org/test/bob/alvin)", "dbusobject"} @@ -73,6 +80,18 @@ main (int argc, char ** argv) return 1; } + if (dbusname == NULL) { + g_print("ERROR: dbus-name not specified\n"); + usage(); + return 1; + } + + if (dbusobject == NULL) { + g_print("ERROR: dbus-object not specified\n"); + usage(); + return 1; + } + return 0; } -- cgit v1.2.3