summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2012-01-24 13:17:40 +0100
committerLinus Nordberg <linus@nordu.net>2012-01-24 13:17:40 +0100
commit4874dc3d84e23b1f465a1ff8b686aca5ba0a5853 (patch)
tree74fe64dc5c9a5a3965861f7f60114e198402a008
parent02d0d00a69efa12cb00b048267b4800d14e5f454 (diff)
Be user friendly in example program.
-rw-r--r--lib/examples/client-blocking.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/examples/client-blocking.c b/lib/examples/client-blocking.c
index eb0648a..73c526d 100644
--- a/lib/examples/client-blocking.c
+++ b/lib/examples/client-blocking.c
@@ -98,6 +98,13 @@ blocking_client (const char *config_fn, const char *configuration,
return err;
}
+void
+usage (int argc, char *argv[])
+{
+ fprintf (stderr, "usage: %s: [-r] config-file config-name\n", argv[0]);
+ exit (1);
+}
+
int
main (int argc, char *argv[])
{
@@ -110,6 +117,8 @@ main (int argc, char *argv[])
argc--;
argv++;
}
+ if (argc < 3)
+ usage (argc, argv);
err = blocking_client (argv[1], argv[2], use_request_object_flag);
if (err)
{