diff options
author | Linus Nordberg <linus@nordu.net> | 2012-01-24 13:17:40 +0100 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2012-01-24 13:17:40 +0100 |
commit | 4874dc3d84e23b1f465a1ff8b686aca5ba0a5853 (patch) | |
tree | 74fe64dc5c9a5a3965861f7f60114e198402a008 | |
parent | 02d0d00a69efa12cb00b048267b4800d14e5f454 (diff) |
Be user friendly in example program.
-rw-r--r-- | lib/examples/client-blocking.c | 9 |
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) { |