From f326449acf6ef042d17e3e86abbb3cf1eccc6a30 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 25 Mar 2014 09:45:28 +0100 Subject: [PATCH] ustream-example-client: fix usage information Signed-off-by: Felix Fietkau --- ustream-example-client.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ustream-example-client.c b/ustream-example-client.c index c3d0018..fc49146 100644 --- a/ustream-example-client.c +++ b/ustream-example-client.c @@ -110,12 +110,17 @@ static void connect_client(void) static int usage(const char *progname) { - fprintf(stderr, "Usage: %s [options] \n", progname); + fprintf(stderr, + "Usage: %s [options] \n" + "Options:\n" + " -c : Load CA certificates from file \n" + "\n", progname); return 1; } int main(int argc, char **argv) { + const char *progname = argv[0]; int ch; ctx = ustream_ssl_context_new(false); @@ -125,6 +130,8 @@ int main(int argc, char **argv) case 'c': ustream_ssl_context_add_ca_crt_file(ctx, optarg); break; + default: + return usage(progname); } } @@ -132,7 +139,7 @@ int main(int argc, char **argv) argc -= optind; if (argc != 2) - return usage(argv[0]); + return usage(progname); uloop_init(); host = argv[0]; -- 2.25.1