Lines Matching +full:- +full:- +full:config
8 * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
70 {"*4", "dns-ipv4-addr", TRUE},
71 {"*6", "dns-ipv6-addr", TRUE},
72 {"*a", "random-file", TRUE},
73 {"*b", "egd-file", TRUE},
74 {"*B", "oauth2-bearer", TRUE},
75 {"*c", "connect-timeout", TRUE},
77 {"*D", "dns-interface", TRUE},
78 {"*e", "disable-epsv", FALSE},
80 /* 'epsv' made like this to make --no-epsv and --epsv to work
81 although --disable-epsv is the documented option */
85 {"*F", "dns-servers", TRUE},
88 {"*h", "trace-ascii", TRUE},
90 {"*i", "limit-rate", TRUE},
92 {"*J", "tr-encoding", FALSE},
96 {"*M", "ntlm-wb", FALSE},
102 {"*q", "ftp-create-dirs", FALSE},
103 {"*r", "create-dirs", FALSE},
104 {"*s", "max-redirs", TRUE},
105 {"*t", "proxy-ntlm", FALSE},
112 {"*y", "max-filesize", TRUE},
113 {"*z", "disable-eprt", FALSE},
115 /* 'eprt' made like this to make --no-eprt and --eprt to work
116 although --disable-eprt is the documented option */
118 {"$a", "ftp-ssl", FALSE},
119 /* 'ftp-ssl' deprecated name since 7.20.0 */
121 /* 'ssl' new option name in 7.20.0, previously this was ftp-ssl */
122 {"$b", "ftp-pasv", FALSE},
124 {"$d", "tcp-nodelay", FALSE},
125 {"$e", "proxy-digest", FALSE},
126 {"$f", "proxy-basic", FALSE},
128 {"$V", "retry-connrefused", FALSE},
129 {"$h", "retry-delay", TRUE},
130 {"$i", "retry-max-time", TRUE},
131 {"$k", "proxy-negotiate", FALSE},
132 {"$m", "ftp-account", TRUE},
133 {"$n", "proxy-anyauth", FALSE},
134 {"$o", "trace-time", FALSE},
135 {"$p", "ignore-content-length", FALSE},
136 {"$q", "ftp-skip-pasv-ip", FALSE},
137 {"$r", "ftp-method", TRUE},
138 {"$s", "local-port", TRUE},
141 {"$u", "ftp-alternative-to-user", TRUE},
142 {"$v", "ftp-ssl-reqd", FALSE},
143 /* 'ftp-ssl-reqd' deprecated name since 7.20.0 */
144 {"$v", "ssl-reqd", FALSE},
145 /* 'ssl-reqd' new in 7.20.0, previously this was ftp-ssl-reqd */
147 /* 'sessionid' listed as --no-sessionid in the help */
148 {"$x", "ftp-ssl-control", FALSE},
149 {"$y", "ftp-ssl-ccc", FALSE},
150 {"$j", "ftp-ssl-ccc-mode", TRUE},
155 /* 'keepalive' listed as --no-keepalive in the help */
156 {"$2", "socks5-hostname", TRUE},
157 {"$3", "keepalive-time", TRUE},
160 {"$7", "socks5-gssapi-nec", FALSE},
162 {"$9", "tftp-blksize", TRUE},
163 {"$A", "mail-from", TRUE},
164 {"$B", "mail-rcpt", TRUE},
165 {"$C", "ftp-pret", FALSE},
167 {"$E", "proto-redir", TRUE},
170 {"$H", "mail-auth", TRUE},
173 {"$K", "sasl-ir", FALSE},
174 {"$L", "test-event", FALSE},
175 {"$M", "unix-socket", TRUE},
176 {"$N", "path-as-is", FALSE},
177 {"$O", "socks5-gssapi-service", TRUE},
178 /* 'socks5-gssapi-service' merged with'proxy-service-name' and
180 {"$O", "proxy-service-name", TRUE},
181 {"$P", "service-name", TRUE},
182 {"$Q", "proto-default", TRUE},
183 {"$R", "expect100-timeout", TRUE},
184 {"$S", "tftp-no-options", FALSE},
185 {"$U", "connect-to", TRUE},
189 {"03", "http2-prior-knowledge", FALSE},
200 {"A", "user-agent", TRUE},
202 {"B", "use-ascii", FALSE},
203 {"c", "cookie-jar", TRUE},
204 {"C", "continue-at", TRUE},
206 {"dr", "data-raw", TRUE},
207 {"da", "data-ascii", TRUE},
208 {"db", "data-binary", TRUE},
209 {"de", "data-urlencode", TRUE},
210 {"D", "dump-header", TRUE},
214 {"Eb", "cert-type", TRUE},
216 {"Ed", "key-type", TRUE},
226 {"En", "ssl-allow-beast", FALSE},
227 {"Eo", "login-options", TRUE},
229 {"Eq", "cert-status", FALSE},
230 {"Er", "false-start", FALSE},
231 {"Es", "ssl-no-revoke", FALSE},
232 {"Et", "tcp-fastopen", FALSE},
233 {"Eu", "proxy-tlsuser", TRUE},
234 {"Ev", "proxy-tlspassword", TRUE},
235 {"Ew", "proxy-tlsauthtype", TRUE},
236 {"Ex", "proxy-cert", TRUE},
237 {"Ey", "proxy-cert-type", TRUE},
238 {"Ez", "proxy-key", TRUE},
239 {"E0", "proxy-key-type", TRUE},
240 {"E1", "proxy-pass", TRUE},
241 {"E2", "proxy-ciphers", TRUE},
242 {"E3", "proxy-crlfile", TRUE},
243 {"E4", "proxy-ssl-allow-beast", FALSE},
244 {"E5", "login-options", TRUE},
245 {"E6", "proxy-cacert", TRUE},
246 {"E7", "proxy-capath", TRUE},
247 {"E8", "proxy-insecure", FALSE},
248 {"E9", "proxy-tlsv1", FALSE},
249 {"EA", "proxy-sslv2", FALSE},
250 {"EB", "proxy-sslv3", FALSE},
252 {"fa", "fail-early", FALSE},
254 {"Fs", "form-string", TRUE},
259 {"Hp", "proxy-header", TRUE},
262 {"j", "junk-session-cookies", FALSE},
263 {"J", "remote-header-name", FALSE},
265 {"K", "config", TRUE},
266 {"l", "list-only", FALSE},
268 {"Lt", "location-trusted", FALSE},
269 {"m", "max-time", TRUE},
272 {"no", "netrc-optional", FALSE},
273 {"ne", "netrc-file", TRUE},
275 /* 'buffer' listed as --no-buffer in the help */
277 {"O", "remote-name", FALSE},
278 {"Oa", "remote-name-all", FALSE},
280 {"P", "ftp-port", TRUE},
284 {"R", "remote-time", FALSE},
286 {"S", "show-error", FALSE},
287 {"t", "telnet-option", TRUE},
288 {"T", "upload-file", TRUE},
290 {"U", "proxy-user", TRUE},
293 {"w", "write-out", TRUE},
296 {"Y", "speed-limit", TRUE},
297 {"y", "speed-time", TRUE},
298 {"z", "time-cond", TRUE},
299 {"#", "progress-bar", FALSE},
303 /* Split the argument of -E to 'certname' and 'passphrase' separated by colon.
326 * looks like a RFC7512 PKCS#11 URI which can be used as-is. in parse_cert_parameter()
346 /* we just ate all the non-special chars. now we're on either a special in parse_cert_parameter()
419 ParameterError getparameter(char *flag, /* f or -long-flag */ in getparameter()
424 struct OperationConfig *config) in getparameter() argument
432 int hit = -1; in getparameter()
434 bool singleopt = FALSE; /* when true means '-o foo' used '-ofoo' */ in getparameter()
437 by using --OPTION or --no-OPTION */ in getparameter()
440 if(('-' != flag[0]) || in getparameter()
441 (('-' == flag[0]) && ('-' == flag[1]))) { in getparameter()
443 char *word = ('-' == flag[0]) ? flag+2 : flag; in getparameter()
447 if(!strncmp(word, "no-", 3)) { in getparameter()
448 /* disable this option but ignore the "no-" part when looking for it */ in getparameter()
477 hit = -1; in getparameter()
482 /* we can loop here if we have multiple single-letters */ in getparameter()
521 case '4': /* --dns-ipv4-addr */ in getparameter()
523 GetStr(&config->dns_ipv4_addr, nextarg); in getparameter()
525 case '6': /* --dns-ipv6-addr */ in getparameter()
527 GetStr(&config->dns_ipv6_addr, nextarg); in getparameter()
529 case 'a': /* random-file */ in getparameter()
530 GetStr(&config->random_file, nextarg); in getparameter()
532 case 'b': /* egd-file */ in getparameter()
533 GetStr(&config->egd_file, nextarg); in getparameter()
536 GetStr(&config->oauth_bearer, nextarg); in getparameter()
538 case 'c': /* connect-timeout */ in getparameter()
539 err = str2udouble(&config->connecttimeout, nextarg); in getparameter()
544 GetStr(&config->cipher_list, nextarg); in getparameter()
546 case 'D': /* --dns-interface */ in getparameter()
548 GetStr(&config->dns_interface, nextarg); in getparameter()
550 case 'e': /* --disable-epsv */ in getparameter()
551 config->disable_epsv = toggle; in getparameter()
553 case 'E': /* --epsv */ in getparameter()
554 config->disable_epsv = (!toggle)?TRUE:FALSE; in getparameter()
558 config->writeenv = toggle; in getparameter()
561 case 'F': /* --dns-servers */ in getparameter()
563 GetStr(&config->dns_servers, nextarg); in getparameter()
565 case 'g': /* --trace */ in getparameter()
566 GetStr(&global->trace_dump, nextarg); in getparameter()
567 if(global->tracetype && (global->tracetype != TRACE_BIN)) in getparameter()
568 warnf(global, "--trace overrides an earlier trace/verbose option\n"); in getparameter()
569 global->tracetype = TRACE_BIN; in getparameter()
571 case 'G': /* --npn */ in getparameter()
572 config->nonpn = (!toggle)?TRUE:FALSE; in getparameter()
574 case 'h': /* --trace-ascii */ in getparameter()
575 GetStr(&global->trace_dump, nextarg); in getparameter()
576 if(global->tracetype && (global->tracetype != TRACE_ASCII)) in getparameter()
578 "--trace-ascii overrides an earlier trace/verbose option\n"); in getparameter()
579 global->tracetype = TRACE_ASCII; in getparameter()
581 case 'H': /* --alpn */ in getparameter()
582 config->noalpn = (!toggle)?TRUE:FALSE; in getparameter()
584 case 'i': /* --limit-rate */ in getparameter()
610 /* for plain bytes, leave as-is */ in getparameter()
616 config->recvpersecond = value; in getparameter()
617 config->sendpersecond = value; in getparameter()
621 case 'j': /* --compressed */ in getparameter()
622 if(toggle && !(curlinfo->features & CURL_VERSION_LIBZ)) in getparameter()
624 config->encoding = toggle; in getparameter()
627 case 'J': /* --tr-encoding */ in getparameter()
628 config->tr_encoding = toggle; in getparameter()
631 case 'k': /* --digest */ in getparameter()
633 config->authtype |= CURLAUTH_DIGEST; in getparameter()
635 config->authtype &= ~CURLAUTH_DIGEST; in getparameter()
638 case 'l': /* --negotiate */ in getparameter()
640 if(curlinfo->features & CURL_VERSION_SPNEGO) in getparameter()
641 config->authtype |= CURLAUTH_NEGOTIATE; in getparameter()
646 config->authtype &= ~CURLAUTH_NEGOTIATE; in getparameter()
649 case 'm': /* --ntlm */ in getparameter()
651 if(curlinfo->features & CURL_VERSION_NTLM) in getparameter()
652 config->authtype |= CURLAUTH_NTLM; in getparameter()
657 config->authtype &= ~CURLAUTH_NTLM; in getparameter()
660 case 'M': /* --ntlm-wb */ in getparameter()
662 if(curlinfo->features & CURL_VERSION_NTLM_WB) in getparameter()
663 config->authtype |= CURLAUTH_NTLM_WB; in getparameter()
668 config->authtype &= ~CURLAUTH_NTLM_WB; in getparameter()
671 case 'n': /* --basic for completeness */ in getparameter()
673 config->authtype |= CURLAUTH_BASIC; in getparameter()
675 config->authtype &= ~CURLAUTH_BASIC; in getparameter()
678 case 'o': /* --anyauth, let libcurl pick it */ in getparameter()
680 config->authtype = CURLAUTH_ANY; in getparameter()
681 /* --no-anyauth simply doesn't touch it */ in getparameter()
685 case 'p': /* --wdebug */ in getparameter()
689 case 'q': /* --ftp-create-dirs */ in getparameter()
690 config->ftp_create_dirs = toggle; in getparameter()
693 case 'r': /* --create-dirs */ in getparameter()
694 config->create_dirs = toggle; in getparameter()
697 case 's': /* --max-redirs */ in getparameter()
698 /* specified max no of redirects (http(s)), this accepts -1 as a in getparameter()
700 err = str2num(&config->maxredirs, nextarg); in getparameter()
703 if(config->maxredirs < -1) in getparameter()
707 case 't': /* --proxy-ntlm */ in getparameter()
708 if(curlinfo->features & CURL_VERSION_NTLM) in getparameter()
709 config->proxyntlm = toggle; in getparameter()
714 case 'u': /* --crlf */ in getparameter()
715 /* LF -> CRLF conversion? */ in getparameter()
716 config->crlf = toggle; in getparameter()
719 case 'v': /* --stderr */ in getparameter()
720 if(strcmp(nextarg, "-")) { in getparameter()
725 if(global->errors_fopened) in getparameter()
726 fclose(global->errors); in getparameter()
727 global->errors = newfile; in getparameter()
728 global->errors_fopened = TRUE; in getparameter()
732 global->errors = stdout; in getparameter()
734 case 'w': /* --interface */ in getparameter()
736 GetStr(&config->iface, nextarg); in getparameter()
738 case 'x': /* --krb */ in getparameter()
740 if(curlinfo->features & CURL_VERSION_KERBEROS4) in getparameter()
741 GetStr(&config->krblevel, nextarg); in getparameter()
745 case 'y': /* --max-filesize */ in getparameter()
746 err = str2offset(&config->max_filesize, nextarg); in getparameter()
750 case 'z': /* --disable-eprt */ in getparameter()
751 config->disable_eprt = toggle; in getparameter()
753 case 'Z': /* --eprt */ in getparameter()
754 config->disable_eprt = (!toggle)?TRUE:FALSE; in getparameter()
756 case '~': /* --xattr */ in getparameter()
757 config->xattr = toggle; in getparameter()
762 if(config->url_get || ((config->url_get = config->url_list) != NULL)) { in getparameter()
763 /* there's a node here, if it already is filled-in continue to find in getparameter()
765 while(config->url_get && (config->url_get->flags & GETOUT_URL)) in getparameter()
766 config->url_get = config->url_get->next; in getparameter()
771 if(config->url_get) in getparameter()
773 url = config->url_get; in getparameter()
776 url = new_getout(config); in getparameter()
782 GetStr(&url->url, nextarg); in getparameter()
783 url->flags |= GETOUT_URL; in getparameter()
790 case 'a': /* --ftp-ssl */ in getparameter()
791 if(toggle && !(curlinfo->features & CURL_VERSION_SSL)) in getparameter()
793 config->ftp_ssl = toggle; in getparameter()
795 case 'b': /* --ftp-pasv */ in getparameter()
796 Curl_safefree(config->ftpport); in getparameter()
798 case 'c': /* --socks5 specifies a socks5 proxy to use, and resolves in getparameter()
800 GetStr(&config->socksproxy, nextarg); in getparameter()
801 config->socksver = CURLPROXY_SOCKS5; in getparameter()
803 case 't': /* --socks4 specifies a socks4 proxy to use */ in getparameter()
804 GetStr(&config->socksproxy, nextarg); in getparameter()
805 config->socksver = CURLPROXY_SOCKS4; in getparameter()
807 case 'T': /* --socks4a specifies a socks4a proxy to use */ in getparameter()
808 GetStr(&config->socksproxy, nextarg); in getparameter()
809 config->socksver = CURLPROXY_SOCKS4A; in getparameter()
811 case '2': /* --socks5-hostname specifies a socks5 proxy and enables name in getparameter()
813 GetStr(&config->socksproxy, nextarg); in getparameter()
814 config->socksver = CURLPROXY_SOCKS5_HOSTNAME; in getparameter()
816 case 'd': /* --tcp-nodelay option */ in getparameter()
817 config->tcp_nodelay = toggle; in getparameter()
819 case 'e': /* --proxy-digest */ in getparameter()
820 config->proxydigest = toggle; in getparameter()
822 case 'f': /* --proxy-basic */ in getparameter()
823 config->proxybasic = toggle; in getparameter()
825 case 'g': /* --retry */ in getparameter()
826 err = str2unum(&config->req_retry, nextarg); in getparameter()
830 case 'V': /* --retry-connrefused */ in getparameter()
831 config->retry_connrefused = toggle; in getparameter()
833 case 'h': /* --retry-delay */ in getparameter()
834 err = str2unum(&config->retry_delay, nextarg); in getparameter()
838 case 'i': /* --retry-max-time */ in getparameter()
839 err = str2unum(&config->retry_maxtime, nextarg); in getparameter()
844 case 'k': /* --proxy-negotiate */ in getparameter()
845 if(curlinfo->features & CURL_VERSION_SPNEGO) in getparameter()
846 config->proxynegotiate = toggle; in getparameter()
851 case 'm': /* --ftp-account */ in getparameter()
852 GetStr(&config->ftp_account, nextarg); in getparameter()
854 case 'n': /* --proxy-anyauth */ in getparameter()
855 config->proxyanyauth = toggle; in getparameter()
857 case 'o': /* --trace-time */ in getparameter()
858 global->tracetime = toggle; in getparameter()
860 case 'p': /* --ignore-content-length */ in getparameter()
861 config->ignorecl = toggle; in getparameter()
863 case 'q': /* --ftp-skip-pasv-ip */ in getparameter()
864 config->ftp_skip_ip = toggle; in getparameter()
866 case 'r': /* --ftp-method (undocumented at this point) */ in getparameter()
867 config->ftp_filemethod = ftpfilemethod(config, nextarg); in getparameter()
869 case 's': /* --local-port */ in getparameter()
870 rc = sscanf(nextarg, "%d - %d", in getparameter()
871 &config->localport, in getparameter()
872 &config->localportrange); in getparameter()
876 config->localportrange = 1; /* default number of ports to try */ in getparameter()
878 config->localportrange -= config->localport; in getparameter()
879 if(config->localportrange < 1) { in getparameter()
885 case 'u': /* --ftp-alternative-to-user */ in getparameter()
886 GetStr(&config->ftp_alternative_to_user, nextarg); in getparameter()
888 case 'v': /* --ftp-ssl-reqd */ in getparameter()
889 if(toggle && !(curlinfo->features & CURL_VERSION_SSL)) in getparameter()
891 config->ftp_ssl_reqd = toggle; in getparameter()
893 case 'w': /* --no-sessionid */ in getparameter()
894 config->disable_sessionid = (!toggle)?TRUE:FALSE; in getparameter()
896 case 'x': /* --ftp-ssl-control */ in getparameter()
897 if(toggle && !(curlinfo->features & CURL_VERSION_SSL)) in getparameter()
899 config->ftp_ssl_control = toggle; in getparameter()
901 case 'y': /* --ftp-ssl-ccc */ in getparameter()
902 config->ftp_ssl_ccc = toggle; in getparameter()
903 if(!config->ftp_ssl_ccc_mode) in getparameter()
904 config->ftp_ssl_ccc_mode = CURLFTPSSL_CCC_PASSIVE; in getparameter()
906 case 'j': /* --ftp-ssl-ccc-mode */ in getparameter()
907 config->ftp_ssl_ccc = TRUE; in getparameter()
908 config->ftp_ssl_ccc_mode = ftpcccmethod(config, nextarg); in getparameter()
910 case 'z': /* --libcurl */ in getparameter()
913 "--libcurl option was disabled at build-time!\n"); in getparameter()
916 GetStr(&global->libcurl, nextarg); in getparameter()
919 case '#': /* --raw */ in getparameter()
920 config->raw = toggle; in getparameter()
922 case '0': /* --post301 */ in getparameter()
923 config->post301 = toggle; in getparameter()
925 case '1': /* --no-keepalive */ in getparameter()
926 config->nokeepalive = (!toggle)?TRUE:FALSE; in getparameter()
928 case '3': /* --keepalive-time */ in getparameter()
929 err = str2unum(&config->alivetime, nextarg); in getparameter()
933 case '4': /* --post302 */ in getparameter()
934 config->post302 = toggle; in getparameter()
936 case 'I': /* --post303 */ in getparameter()
937 config->post303 = toggle; in getparameter()
939 case '5': /* --noproxy */ in getparameter()
941 GetStr(&config->noproxy, nextarg); in getparameter()
943 case '7': /* --socks5-gssapi-nec*/ in getparameter()
944 config->socks5_gssapi_nec = toggle; in getparameter()
946 case '8': /* --proxy1.0 */ in getparameter()
948 GetStr(&config->proxy, nextarg); in getparameter()
949 config->proxyver = CURLPROXY_HTTP_1_0; in getparameter()
951 case '9': /* --tftp-blksize */ in getparameter()
952 err = str2unum(&config->tftp_blksize, nextarg); in getparameter()
956 case 'A': /* --mail-from */ in getparameter()
957 GetStr(&config->mail_from, nextarg); in getparameter()
959 case 'B': /* --mail-rcpt */ in getparameter()
961 err = add2list(&config->mail_rcpt, nextarg); in getparameter()
965 case 'C': /* --ftp-pret */ in getparameter()
966 config->ftp_pret = toggle; in getparameter()
968 case 'D': /* --proto */ in getparameter()
969 config->proto_present = TRUE; in getparameter()
970 if(proto2num(config, &config->proto, nextarg)) in getparameter()
973 case 'E': /* --proto-redir */ in getparameter()
974 config->proto_redir_present = TRUE; in getparameter()
975 if(proto2num(config, &config->proto_redir, nextarg)) in getparameter()
978 case 'F': /* --resolve */ in getparameter()
979 err = add2list(&config->resolve, nextarg); in getparameter()
983 case 'G': /* --delegation LEVEL */ in getparameter()
984 config->gssapi_delegation = delegation(config, nextarg); in getparameter()
986 case 'H': /* --mail-auth */ in getparameter()
987 GetStr(&config->mail_auth, nextarg); in getparameter()
989 case 'J': /* --metalink */ in getparameter()
996 "--metalink option cannot be used because the version of " in getparameter()
1006 config->use_metalink = toggle; in getparameter()
1008 warnf(global, "--metalink option is ignored because the binary is " in getparameter()
1013 case 'K': /* --sasl-ir */ in getparameter()
1014 config->sasl_ir = toggle; in getparameter()
1016 case 'L': /* --test-event */ in getparameter()
1018 config->test_event_based = toggle; in getparameter()
1020 warnf(global, "--test-event is ignored unless a debug build!\n"); in getparameter()
1023 case 'M': /* --unix-socket */ in getparameter()
1024 GetStr(&config->unix_socket_path, nextarg); in getparameter()
1026 case 'N': /* --path-as-is */ in getparameter()
1027 config->path_as_is = toggle; in getparameter()
1029 case 'O': /* --proxy-service-name */ in getparameter()
1030 GetStr(&config->proxy_service_name, nextarg); in getparameter()
1032 case 'P': /* --service-name */ in getparameter()
1033 GetStr(&config->service_name, nextarg); in getparameter()
1035 case 'Q': /* --proto-default */ in getparameter()
1036 GetStr(&config->proto_default, nextarg); in getparameter()
1037 err = check_protocol(config->proto_default); in getparameter()
1041 case 'R': /* --expect100-timeout */ in getparameter()
1042 err = str2udouble(&config->expect100timeout, nextarg); in getparameter()
1046 case 'S': /* --tftp-no-options */ in getparameter()
1047 config->tftp_no_options = toggle; in getparameter()
1049 case 'U': /* --connect-to */ in getparameter()
1050 err = add2list(&config->connect_to, nextarg); in getparameter()
1056 case '#': /* --progress-bar */ in getparameter()
1058 global->progressmode = CURL_PROGRESS_BAR; in getparameter()
1060 global->progressmode = CURL_PROGRESS_STATS; in getparameter()
1062 case ':': /* --next */ in getparameter()
1064 case '0': /* --http* options */ in getparameter()
1068 config->httpversion = CURL_HTTP_VERSION_1_0; in getparameter()
1072 config->httpversion = CURL_HTTP_VERSION_1_1; in getparameter()
1076 config->httpversion = CURL_HTTP_VERSION_2_0; in getparameter()
1080 config->httpversion = CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE; in getparameter()
1084 case '1': /* --tlsv1* options */ in getparameter()
1088 config->ssl_version = CURL_SSLVERSION_TLSv1; in getparameter()
1092 config->ssl_version = CURL_SSLVERSION_TLSv1_0; in getparameter()
1096 config->ssl_version = CURL_SSLVERSION_TLSv1_1; in getparameter()
1100 config->ssl_version = CURL_SSLVERSION_TLSv1_2; in getparameter()
1104 config->ssl_version = CURL_SSLVERSION_TLSv1_3; in getparameter()
1110 config->ssl_version = CURL_SSLVERSION_SSLv2; in getparameter()
1114 config->ssl_version = CURL_SSLVERSION_SSLv3; in getparameter()
1118 config->ip_version = 4; in getparameter()
1122 config->ip_version = 6; in getparameter()
1126 config->ftp_append = toggle; in getparameter()
1129 /* This specifies the User-Agent name */ in getparameter()
1130 GetStr(&config->useragent, nextarg); in getparameter()
1137 /* A cookie string must have a =-letter */ in getparameter()
1138 GetStr(&config->cookie, nextarg); in getparameter()
1142 GetStr(&config->cookiefile, nextarg); in getparameter()
1146 config->use_ascii = toggle; in getparameter()
1150 GetStr(&config->cookiejar, nextarg); in getparameter()
1154 if(strcmp(nextarg, "-")) { in getparameter()
1155 err = str2offset(&config->resume_from, nextarg); in getparameter()
1158 config->resume_from_current = FALSE; in getparameter()
1161 config->resume_from_current = TRUE; in getparameter()
1162 config->resume_from = 0; in getparameter()
1164 config->use_resume=TRUE; in getparameter()
1174 if(subletter == 'e') { /* --data-urlencode*/ in getparameter()
1188 nlen = p - nextarg; /* length of the name part */ in getparameter()
1197 /* a '@' letter, it means that a file name or - (stdin) follows */ in getparameter()
1198 if(!strcmp("-", p)) { in getparameter()
1232 char *enc = curl_easy_escape(config->easy, postdata, (int)size); in getparameter()
1245 size = outlen-1; in getparameter()
1249 size = outlen-2; /* since no '=' was inserted */ in getparameter()
1260 or - (stdin) follows */ in getparameter()
1263 if(!strcmp("-", nextarg)) { in getparameter()
1265 if(subletter == 'b') /* forced data-binary */ in getparameter()
1313 if(config->postfields) { in getparameter()
1315 &-letter */ in getparameter()
1316 char *oldpost = config->postfields; in getparameter()
1317 curl_off_t oldlen = config->postfieldsize; in getparameter()
1319 config->postfields = malloc((size_t)newlen); in getparameter()
1320 if(!config->postfields) { in getparameter()
1325 memcpy(config->postfields, oldpost, (size_t)oldlen); in getparameter()
1326 /* use byte value 0x26 for '&' to accommodate non-ASCII platforms */ in getparameter()
1327 config->postfields[oldlen] = '\x26'; in getparameter()
1328 memcpy(&config->postfields[oldlen+1], postdata, size); in getparameter()
1329 config->postfields[oldlen+1+size] = '\0'; in getparameter()
1332 config->postfieldsize += size+1; in getparameter()
1335 config->postfields = postdata; in getparameter()
1336 config->postfieldsize = curlx_uztoso(size); in getparameter()
1341 a simple GET if -G is used. Already or soon. in getparameter()
1343 if(SetHTTPrequest(HTTPREQ_SIMPLEPOST, &config->httpreq)) { in getparameter()
1350 /* dump-header to given file name */ in getparameter()
1351 GetStr(&config->headerfile, nextarg); in getparameter()
1359 config->autoreferer = TRUE; in getparameter()
1363 config->autoreferer = FALSE; in getparameter()
1364 GetStr(&config->referer, nextarg); in getparameter()
1370 GetFileAndPassword(nextarg, &config->cert, &config->key_passwd); in getparameter()
1374 GetStr(&config->cacert, nextarg); in getparameter()
1377 GetStr(&config->cert_type, nextarg); in getparameter()
1380 GetStr(&config->key, nextarg); in getparameter()
1383 GetStr(&config->key_type, nextarg); in getparameter()
1386 GetStr(&config->key_passwd, nextarg); in getparameter()
1390 GetStr(&config->engine, nextarg); in getparameter()
1391 if(config->engine && curl_strequal(config->engine, "list")) in getparameter()
1396 GetStr(&config->capath, nextarg); in getparameter()
1398 case 'h': /* --pubkey public key file */ in getparameter()
1399 GetStr(&config->pubkey, nextarg); in getparameter()
1401 case 'i': /* --hostpubmd5 md5 of the host public key */ in getparameter()
1402 GetStr(&config->hostpubmd5, nextarg); in getparameter()
1403 if(!config->hostpubmd5 || strlen(config->hostpubmd5) != 32) in getparameter()
1408 GetStr(&config->crlfile, nextarg); in getparameter()
1411 if(curlinfo->features & CURL_VERSION_TLSAUTH_SRP) in getparameter()
1412 GetStr(&config->tls_username, nextarg); in getparameter()
1417 if(curlinfo->features & CURL_VERSION_TLSAUTH_SRP) in getparameter()
1418 GetStr(&config->tls_password, nextarg); in getparameter()
1423 if(curlinfo->features & CURL_VERSION_TLSAUTH_SRP) { in getparameter()
1424 GetStr(&config->tls_authtype, nextarg); in getparameter()
1425 if(!curl_strequal(config->tls_authtype, "SRP")) in getparameter()
1426 return PARAM_LIBCURL_DOESNT_SUPPORT; /* only support TLS-SRP */ in getparameter()
1431 case 'n': /* no empty SSL fragments, --ssl-allow-beast */ in getparameter()
1432 if(curlinfo->features & CURL_VERSION_SSL) in getparameter()
1433 config->ssl_allow_beast = toggle; in getparameter()
1436 case 'o': /* --login-options */ in getparameter()
1437 GetStr(&config->login_options, nextarg); in getparameter()
1442 GetStr(&config->pinnedpubkey, nextarg); in getparameter()
1445 case 'q': /* --cert-status */ in getparameter()
1446 config->verifystatus = TRUE; in getparameter()
1449 case 'r': /* --false-start */ in getparameter()
1450 config->falsestart = TRUE; in getparameter()
1453 case 's': /* --ssl-no-revoke */ in getparameter()
1454 if(curlinfo->features & CURL_VERSION_SSL) in getparameter()
1455 config->ssl_no_revoke = TRUE; in getparameter()
1458 case 't': /* --tcp-fastopen */ in getparameter()
1459 config->tcp_fastopen = TRUE; in getparameter()
1463 if(curlinfo->features & CURL_VERSION_TLSAUTH_SRP) in getparameter()
1464 GetStr(&config->proxy_tls_username, nextarg); in getparameter()
1470 if(curlinfo->features & CURL_VERSION_TLSAUTH_SRP) in getparameter()
1471 GetStr(&config->proxy_tls_password, nextarg); in getparameter()
1477 if(curlinfo->features & CURL_VERSION_TLSAUTH_SRP) { in getparameter()
1478 GetStr(&config->proxy_tls_authtype, nextarg); in getparameter()
1479 if(!curl_strequal(config->proxy_tls_authtype, "SRP")) in getparameter()
1480 return PARAM_LIBCURL_DOESNT_SUPPORT; /* only support TLS-SRP */ in getparameter()
1487 GetFileAndPassword(nextarg, &config->proxy_cert, in getparameter()
1488 &config->proxy_key_passwd); in getparameter()
1492 GetStr(&config->proxy_cert_type, nextarg); in getparameter()
1496 GetStr(&config->proxy_key, nextarg); in getparameter()
1500 GetStr(&config->proxy_key_type, nextarg); in getparameter()
1504 GetStr(&config->proxy_key_passwd, nextarg); in getparameter()
1509 GetStr(&config->proxy_cipher_list, nextarg); in getparameter()
1514 GetStr(&config->proxy_crlfile, nextarg); in getparameter()
1518 if(curlinfo->features & CURL_VERSION_SSL) in getparameter()
1519 config->proxy_ssl_allow_beast = toggle; in getparameter()
1522 case '5': /* --login-options */ in getparameter()
1523 GetStr(&config->login_options, nextarg); in getparameter()
1528 GetStr(&config->proxy_cacert, nextarg); in getparameter()
1533 GetStr(&config->proxy_capath, nextarg); in getparameter()
1537 config->proxy_insecure_ok = toggle; in getparameter()
1542 config->proxy_ssl_version = CURL_SSLVERSION_TLSv1; in getparameter()
1547 config->proxy_ssl_version = CURL_SSLVERSION_SSLv2; in getparameter()
1552 config->proxy_ssl_version = CURL_SSLVERSION_SSLv3; in getparameter()
1561 case 'a': /* --fail-early */ in getparameter()
1562 global->fail_early = toggle; in getparameter()
1566 config->failonerror = toggle; in getparameter()
1572 if(formparse(config, in getparameter()
1574 &config->httppost, in getparameter()
1575 &config->last_post, in getparameter()
1578 if(SetHTTPrequest(config, HTTPREQ_FORMPOST, &config->httpreq)) in getparameter()
1583 config->globoff = toggle; in getparameter()
1587 config->use_httpget = TRUE; in getparameter()
1594 /* we now actually support --no-help too! */ in getparameter()
1598 if(subletter == 'p') /* --proxy-header */ in getparameter()
1599 err = add2list(&config->proxyheaders, nextarg); in getparameter()
1601 err = add2list(&config->headers, nextarg); in getparameter()
1606 config->include_headers = toggle; /* include the headers as well in the in getparameter()
1610 config->cookiesession = toggle; in getparameter()
1616 config->no_body = toggle; in getparameter()
1617 if(SetHTTPrequest(config, in getparameter()
1618 (config->no_body)?HTTPREQ_HEAD:HTTPREQ_GET, in getparameter()
1619 &config->httpreq)) in getparameter()
1622 case 'J': /* --remote-header-name */ in getparameter()
1623 if(config->include_headers) { in getparameter()
1625 "--include and --remote-header-name cannot be combined.\n"); in getparameter()
1628 config->content_disposition = toggle; in getparameter()
1631 config->insecure_ok = toggle; in getparameter()
1633 case 'K': /* parse config file */ in getparameter()
1635 warnf(global, "error trying read config from the '%s' file\n", in getparameter()
1639 config->dirlistonly = toggle; /* only list the names of the FTP dir */ in getparameter()
1642 config->followlocation = toggle; /* Follow Location: HTTP headers */ in getparameter()
1647 config->unrestricted_auth = toggle; in getparameter()
1653 err = str2udouble(&config->timeout, nextarg); in getparameter()
1658 if(toggle) { /* --no-manual shows no manual... */ in getparameter()
1663 "built-in manual was disabled at build-time!\n"); in getparameter()
1672 config->netrc_opt = toggle; in getparameter()
1674 case 'e': /* netrc-file */ in getparameter()
1675 GetStr(&config->netrc_file, nextarg); in getparameter()
1680 config->netrc = toggle; in getparameter()
1686 --buffer but is mostly used in the negative form: --no-buffer */ in getparameter()
1688 config->nobuffer = (!toggle)?TRUE:FALSE; in getparameter()
1690 config->nobuffer = toggle; in getparameter()
1692 case 'O': /* --remote-name */ in getparameter()
1693 if(subletter == 'a') { /* --remote-name-all */ in getparameter()
1694 config->default_node_flags = toggle?GETOUT_USEREMOTE:0; in getparameter()
1697 /* fall-through! */ in getparameter()
1698 case 'o': /* --output */ in getparameter()
1702 if(config->url_out || ((config->url_out = config->url_list) != NULL)) { in getparameter()
1703 /* there's a node here, if it already is filled-in continue to find in getparameter()
1705 while(config->url_out && (config->url_out->flags & GETOUT_OUTFILE)) in getparameter()
1706 config->url_out = config->url_out->next; in getparameter()
1711 if(config->url_out) in getparameter()
1713 url = config->url_out; in getparameter()
1716 url = new_getout(config); in getparameter()
1723 GetStr(&url->outfile, nextarg); in getparameter()
1724 url->flags &= ~GETOUT_USEREMOTE; /* switch off */ in getparameter()
1727 url->outfile = NULL; /* leave it */ in getparameter()
1729 url->flags |= GETOUT_USEREMOTE; /* switch on */ in getparameter()
1731 url->flags &= ~GETOUT_USEREMOTE; /* switch off */ in getparameter()
1733 url->flags |= GETOUT_OUTFILE; in getparameter()
1743 GetStr(&config->ftpport, nextarg); in getparameter()
1746 /* proxy tunnel for non-http protocols */ in getparameter()
1747 config->proxytunnel = toggle; in getparameter()
1756 case '-': in getparameter()
1759 err = add2list(&config->postquote, nextarg); in getparameter()
1762 /* prefixed with a plus makes it a just-before-transfer one */ in getparameter()
1764 err = add2list(&config->prequote, nextarg); in getparameter()
1767 err = add2list(&config->quote, nextarg); in getparameter()
1776 claimed that to be a good way, why this code is added to work-around in getparameter()
1778 if(ISDIGIT(*nextarg) && !strchr(nextarg, '-')) { in getparameter()
1782 "A specified range MUST include at least one dash (-). " in getparameter()
1785 snprintf(buffer, sizeof(buffer), "%" CURL_FORMAT_CURL_OFF_T "-", off); in getparameter()
1786 Curl_safefree(config->range); in getparameter()
1787 config->range = strdup(buffer); in getparameter()
1788 if(!config->range) in getparameter()
1796 if(!ISDIGIT(*tmp_range) && *tmp_range != '-' && *tmp_range != ',') { in getparameter()
1799 "\'start\'-\'stop\'. The server's response to this " in getparameter()
1806 GetStr(&config->range, nextarg); in getparameter()
1811 config->remote_time = toggle; in getparameter()
1816 global->mute = global->noprogress = TRUE; in getparameter()
1818 global->mute = global->noprogress = FALSE; in getparameter()
1819 if(global->showerror < 0) in getparameter()
1821 toggle. This is to allow -S and -s to be used in an independent in getparameter()
1823 global->showerror = (!toggle)?TRUE:FALSE; /* toggle off */ in getparameter()
1827 global->showerror = toggle?1:0; /* toggle on if used with -s */ in getparameter()
1831 err = add2list(&config->telnet_options, nextarg); in getparameter()
1839 if(config->url_out || ((config->url_out = config->url_list) != NULL)) { in getparameter()
1840 /* there's a node here, if it already is filled-in continue to find in getparameter()
1842 while(config->url_out && (config->url_out->flags & GETOUT_UPLOAD)) in getparameter()
1843 config->url_out = config->url_out->next; in getparameter()
1848 if(config->url_out) in getparameter()
1850 url = config->url_out; in getparameter()
1853 url = new_getout(config); in getparameter()
1858 url->flags |= GETOUT_UPLOAD; /* mark -T used */ in getparameter()
1860 url->flags |= GETOUT_NOUPLOAD; in getparameter()
1862 /* "-" equals stdin, but keep the string around for now */ in getparameter()
1863 GetStr(&url->infile, nextarg); in getparameter()
1870 GetStr(&config->userpwd, nextarg); in getparameter()
1875 GetStr(&config->proxyuserpwd, nextarg); in getparameter()
1881 Curl_safefree(global->trace_dump); in getparameter()
1882 global->trace_dump = strdup("%"); in getparameter()
1883 if(!global->trace_dump) in getparameter()
1885 if(global->tracetype && (global->tracetype != TRACE_PLAIN)) in getparameter()
1887 "-v, --verbose overrides an earlier trace/verbose option\n"); in getparameter()
1888 global->tracetype = TRACE_PLAIN; in getparameter()
1892 global->tracetype = TRACE_NONE; in getparameter()
1895 if(toggle) /* --no-version yields no output! */ in getparameter()
1903 or - (stdin) follows */ in getparameter()
1907 if(!strcmp("-", nextarg)) { in getparameter()
1915 err = file2string(&config->writeout, file); in getparameter()
1920 if(!config->writeout) in getparameter()
1924 GetStr(&config->writeout, nextarg); in getparameter()
1928 GetStr(&config->proxy, nextarg); in getparameter()
1929 config->proxyver = CURLPROXY_HTTP; in getparameter()
1933 GetStr(&config->customrequest, nextarg); in getparameter()
1937 err = str2unum(&config->low_speed_time, nextarg); in getparameter()
1940 if(!config->low_speed_limit) in getparameter()
1941 config->low_speed_limit = 1; in getparameter()
1945 err = str2unum(&config->low_speed_limit, nextarg); in getparameter()
1948 if(!config->low_speed_time) in getparameter()
1949 config->low_speed_time = 30; in getparameter()
1957 /* If-Modified-Since: (section 14.28 in RFC2068) */ in getparameter()
1958 config->timecond = CURL_TIMECOND_IFMODSINCE; in getparameter()
1960 case '-': in getparameter()
1961 /* If-Unmodified-Since: (section 14.24 in RFC2068) */ in getparameter()
1962 config->timecond = CURL_TIMECOND_IFUNMODSINCE; in getparameter()
1966 /* Last-Modified: (section 14.29 in RFC2068) */ in getparameter()
1967 config->timecond = CURL_TIMECOND_LASTMOD; in getparameter()
1972 config->condtime=curl_getdate(nextarg, &now); in getparameter()
1973 if(-1 == (int)config->condtime) { in getparameter()
1976 if(-1 == stat(nextarg, &statbuf)) { in getparameter()
1978 config->timecond = CURL_TIMECOND_NONE; in getparameter()
1980 "Illegal date format for -z, --timecond (and not " in getparameter()
1986 config->condtime = statbuf.st_mtime; in getparameter()
1993 hit = -1; in getparameter()
2000 ParameterError parse_args(struct GlobalConfig *config, int argc, in parse_args() argument
2007 struct OperationConfig *operation = config->first; in parse_args()
2012 if(stillflags && ('-' == argv[i][0])) { in parse_args()
2017 if(!strcmp("--", argv[i])) in parse_args()
2019 following (URL) argument to start with -. */ in parse_args()
2022 nextarg = (i < (argc - 1)) ? argv[i + 1] : NULL; in parse_args()
2024 result = getparameter(flag, nextarg, &passarg, config, operation); in parse_args()
2030 if(operation->url_list && operation->url_list->url) { in parse_args()
2031 /* Allocate the next config */ in parse_args()
2032 operation->next = malloc(sizeof(struct OperationConfig)); in parse_args()
2033 if(operation->next) { in parse_args()
2034 /* Initialise the newly created config */ in parse_args()
2035 config_init(operation->next); in parse_args()
2038 operation->next->easy = config->easy; in parse_args()
2040 /* Set the global config pointer */ in parse_args()
2041 operation->next->global = config; in parse_args()
2044 config->last = operation->next; in parse_args()
2046 /* Move onto the new config */ in parse_args()
2047 operation->next->prev = operation; in parse_args()
2048 operation = operation->next; in parse_args()
2062 result = getparameter((char *)"--url", argv[i], &used, config, in parse_args()
2074 helpf(config->errors, "option %s: %s\n", orig_opt, reason); in parse_args()
2076 helpf(config->errors, "%s\n", reason); in parse_args()