diff options
author | Ted Gould <ted@canonical.com> | 2009-10-05 14:45:47 -0400 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-10-05 14:45:47 -0400 |
commit | 0eda58a6e59f479c788e05cc781b2a178d6ff8c0 (patch) | |
tree | 4d5566f515ca46773b917713cb5d2882ffdf9be1 /tools | |
parent | 16e4975a08b5c1024cb974d0785e51eca3c0ab48 (diff) | |
download | libdbusmenu-0eda58a6e59f479c788e05cc781b2a178d6ff8c0.tar.gz libdbusmenu-0eda58a6e59f479c788e05cc781b2a178d6ff8c0.tar.bz2 libdbusmenu-0eda58a6e59f479c788e05cc781b2a178d6ff8c0.zip |
Checking the dbusname and object to ensure that we get them.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dbusmenu-dumper.c | 19 |
1 files changed, 19 insertions, 0 deletions
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=<name> --dbus-object=<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; } |