static int usage(const char *progname)
{
- fprintf(stderr, "Usage: %s [options] <hostname> <port>\n", progname);
+ fprintf(stderr,
+ "Usage: %s [options] <hostname> <port>\n"
+ "Options:\n"
+ " -c <cert>: Load CA certificates from file <cert>\n"
+ "\n", progname);
return 1;
}
int main(int argc, char **argv)
{
+ const char *progname = argv[0];
int ch;
ctx = ustream_ssl_context_new(false);
case 'c':
ustream_ssl_context_add_ca_crt_file(ctx, optarg);
break;
+ default:
+ return usage(progname);
}
}
argc -= optind;
if (argc != 2)
- return usage(argv[0]);
+ return usage(progname);
uloop_init();
host = argv[0];