/***************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Original Code is Curl. * * The Initial Developer of the Original Code is Daniel Stenberg. * * Portions created by the Initial Developer are Copyright (C) 1998. * All Rights Reserved. * * ------------------------------------------------------------ * Main author: * - Daniel Stenberg * * http://curl.haxx.nu * * $Source$ * $Revision$ * $Date$ * $Author$ * $State$ * $Locker$ * * ------------------------------------------------------------ ****************************************************************************/ #include #include #include #include #include #include #include #include #include "../lib/getdate.h" #include "urlglob.h" #define CURLseparator "--_curl_--" #define MIMEseparator "_curl_" /* This define make use of the "Curlseparator" as opposed to the MIMEseparator. We might add support for the latter one in the future, and that's why this is left in the source. */ #define CURL_SEPARATORS /* This is now designed to have its own local setup.h */ #include "setup.h" #include "version.h" #ifdef HAVE_IO_H /* typical win32 habit */ #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifndef HAVE_STRDUP /* Ultrix doesn't have strdup(), so make a quick clone: */ char *strdup(char *str) { int len; char *newstr; len = strlen(str); newstr = (char *) malloc((len+1)*sizeof(char)); if (!newstr) return (char *)NULL; strcpy(newstr,str); return newstr; } #endif extern void hugehelp(void); static void helpf(char *fmt, ...) { va_list ap; if(fmt) { va_start(ap, fmt); fputs("curl: ", stderr); /* prefix it */ vfprintf(stderr, fmt, ap); va_end(ap); } fprintf(stderr, "curl: try 'curl --help' for more information\n"); } static void help(void) { printf(CURL_ID "%s\n" "Usage: curl [options...] \n" "Options: (H) means HTTP/HTTPS only, (F) means FTP only\n" " -a/--append Append to target file when uploading (F)\n" " -A/--user-agent User-Agent to send to server (H)\n" " -b/--cookie Cookie string or file to read cookies from (H)\n" " -B/--ftp-ascii Use ASCII transfer (F)\n" " -c/--continue Resume a previous transfer where we left it\n" " -C/--continue-at Specify absolute resume offset\n" " -d/--data POST data (H)\n" " -D/--dump-header Write the headers to this file\n" " -e/--referer Referer page (H)\n" " -E/--cert Specifies your certificate file and password (HTTPS)\n" " -f/--fail Fail silently (no output at all) on errors (H)\n" " -F/--form Specify HTTP POST data (H)\n" " -h/--help This help text\n" " -H/--header Custom header to pass to server. (H)\n" " -i/--include Include the HTTP-header in the output (H)\n" " -I/--head Fetch document info only (HTTP HEAD/FTP SIZE)\n" " -K/--config Specify which config file to read\n" " -l/--list-only List only names of an FTP directory (F)\n" " -L/--location Follow Location: hints (H)\n" " -m/--max-time Maximum time allowed for the transfer\n" " -M/--manual Display huge help text\n" " -n/--netrc Read .netrc for user name and password\n" " -N/--no-buffer Disables the buffering of the output stream\n" " -o/--output Write output to instead of stdout\n" " -O/--remote-name Write output to a file named as the remote file\n" #if 0 " -p/--port Use port other than default for current protocol.\n" #endif " -P/--ftpport
Use PORT with address instead of PASV when ftping (F)\n" " -q When used as the first parameter disables .curlrc\n" " -Q/--quote Send QUOTE command to FTP before file transfer (F)\n" " -r/--range Retrieve a byte range from a HTTP/1.1 or FTP server\n" " -s/--silent Silent mode. Don't output anything\n" " -S/--show-error Show error. With -s, make curl show errors when they occur\n" " -t/--upload Transfer/upload stdin to remote site\n" " -T/--upload-file Transfer/upload to remote site\n" " -u/--user Specify user and password to use\n" " -U/--proxy-user Specify Proxy authentication\n" " -v/--verbose Makes the operation more talkative\n" " -V/--version Outputs version number then quits\n" " -w/--write-out [format] What to output after completion\n" " -x/--proxy Use proxy. (Default port is 1080)\n" " -X/--request Specific request command to use\n" " -y/--speed-time Time needed to trig speed-limit abort. Defaults to 30\n" " -Y/--speed-limit Stop transfer if below speed-limit for 'speed-time' secs\n" " -z/--time-cond