Lines Matching refs:opts

87 parse_options(poptContext pc, struct tool_options *opts)
94 opts->method = TCURL_HTTP_GET;
97 opts->method = TCURL_HTTP_PUT;
100 opts->method = TCURL_HTTP_POST;
103 opts->method = TCURL_HTTP_DELETE;
123 struct tool_options *opts,
145 headers = opts->headers == NULL ? default_headers : opts->headers;
155 switch (opts->method) {
185 requests[i] = tcurl_http(requests, opts->method, opts->socket_path,
192 if (opts->raw) {
199 if (opts->tls) {
200 ret = tcurl_req_verify_peer(requests[i], opts->capath, opts->cacert,
201 opts->verify_peer, opts->verify_host);
207 if (opts->clientcert != NULL) {
208 ret = tcurl_req_set_client_cert(requests[i], opts->clientcert,
209 opts->clientkey);
215 if (opts->username != NULL && opts->password != NULL) {
216 ret = tcurl_req_http_basic_auth(requests[i], opts->username,
217 opts->password);
306 struct tool_options opts = { 0 };
314 { "debug", '\0', POPT_ARG_INT, &opts.debug, 0, "The debug level to run with", NULL },
315 { "socket-path", 's', POPT_ARG_STRING, &opts.socket_path, 0, "The path to the HTTP server socket", NULL },
321 { "header", 'h', POPT_ARG_ARGV, &opts.headers, '\0', "Add HTTP header", NULL },
323 { "raw", 'r', POPT_ARG_NONE, &opts.raw, '\0', "Print raw protocol output", NULL },
324 { "verbose", 'v', POPT_ARG_NONE, &opts.verbose, '\0', "Print response code and body", NULL },
326 { "tls", '\0', POPT_ARG_NONE, &opts.tls, '\0', "Enable TLS", NULL },
327 { "verify-peer", '\0', POPT_ARG_NONE, &opts.verify_peer, '\0', "Verify peer when TLS is enabled", NULL },
328 { "verify-host", '\0', POPT_ARG_NONE, &opts.verify_host, '\0', "Verify host when TLS is enabled", NULL },
329 { "capath", '\0', POPT_ARG_STRING, &opts.capath, '\0', "Path to CA directory where peer certificate is stored", NULL },
330 { "cacert", '\0', POPT_ARG_STRING, &opts.cacert, '\0', "Path to CA certificate", NULL },
331 { "clientcert", '\0', POPT_ARG_STRING, &opts.clientcert, '\0', "Path to client's certificate", NULL },
332 { "clientkey", '\0', POPT_ARG_STRING, &opts.clientkey, '\0', "Path to client's private key", NULL },
334 { "username", '\0', POPT_ARG_STRING, &opts.username, '\0', "Username for basic authentication", NULL },
335 { "password", '\0', POPT_ARG_STRING, &opts.password, '\0', "Password for basic authentication", NULL },
349 ret = parse_options(pc, &opts);
356 DEBUG_CLI_INIT(opts.debug);
357 tool_ctx->verbose = opts.verbose;
359 ret = prepare_requests(tool_ctx, pc, &opts, &requests, &tool_ctx->nreqs);