From: Felix Fietkau Date: Tue, 25 Mar 2014 08:45:28 +0000 (+0100) Subject: ustream-example-client: fix usage information X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f326449acf6ef042d17e3e86abbb3cf1eccc6a30;p=oweals%2Fustream-ssl.git ustream-example-client: fix usage information Signed-off-by: Felix Fietkau --- 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];