docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
---
|
2023-01-02 20:51:48 +08:00
|
|
|
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
2022-06-14 06:12:03 +08:00
|
|
|
SPDX-License-Identifier: curl
|
2016-11-16 06:44:58 +08:00
|
|
|
Long: config
|
|
|
|
Arg: <file>
|
|
|
|
Help: Read config from a file
|
|
|
|
Short: K
|
2020-07-13 20:15:04 +08:00
|
|
|
Category: curl
|
2021-09-28 17:50:07 +08:00
|
|
|
Added: 4.10
|
2022-10-18 16:39:43 +08:00
|
|
|
Multi: append
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
See-also:
|
|
|
|
- disable
|
|
|
|
Example:
|
|
|
|
- --config file.txt $URL
|
2016-11-16 06:44:58 +08:00
|
|
|
---
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
|
|
|
|
# `--config`
|
|
|
|
|
2017-05-16 14:49:11 +08:00
|
|
|
Specify a text file to read curl arguments from. The command line arguments
|
2023-09-08 20:32:29 +08:00
|
|
|
found in the text file are used as if they were provided on the command
|
2017-05-16 14:49:11 +08:00
|
|
|
line.
|
|
|
|
|
|
|
|
Options and their parameters must be specified on the same line in the file,
|
2016-11-16 06:44:58 +08:00
|
|
|
separated by whitespace, colon, or the equals sign. Long option names can
|
|
|
|
optionally be given in the config file without the initial double dashes and
|
|
|
|
if so, the colon or equals characters can be used as separators. If the option
|
|
|
|
is specified with one or two dashes, there can be no colon or equals character
|
|
|
|
between the option and its parameter.
|
|
|
|
|
2023-07-31 17:50:28 +08:00
|
|
|
If the parameter contains whitespace or starts with a colon (:) or equals sign
|
2024-02-23 19:52:09 +08:00
|
|
|
(=), it must be specified enclosed within double quotes ("like this"). Within
|
|
|
|
double quotes the following escape sequences are available: \\, \", \t, \n, \r
|
|
|
|
and \v. A backslash preceding any other letter is ignored.
|
2021-07-16 14:40:44 +08:00
|
|
|
|
2023-07-31 17:50:28 +08:00
|
|
|
If the first non-blank column of a config line is a '#' character, that line
|
2023-09-08 20:32:29 +08:00
|
|
|
is treated as a comment.
|
2021-07-16 14:40:44 +08:00
|
|
|
|
2023-07-13 14:49:20 +08:00
|
|
|
Only write one option per physical line in the config file. A single line is
|
|
|
|
required to be no more than 10 megabytes (since 8.2.0).
|
2016-11-16 06:44:58 +08:00
|
|
|
|
2024-03-12 17:34:58 +08:00
|
|
|
Specify the filename to --config as minus "-" to make curl read the file from
|
|
|
|
stdin.
|
2016-11-16 06:44:58 +08:00
|
|
|
|
|
|
|
Note that to be able to specify a URL in the config file, you need to specify
|
|
|
|
it using the --url option, and not by simply writing the URL on its own
|
|
|
|
line. So, it could look similar to this:
|
|
|
|
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
url = "https://curl.se/docs/"
|
2016-11-16 06:44:58 +08:00
|
|
|
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
# --- Example file ---
|
|
|
|
# this is a comment
|
|
|
|
url = "example.com"
|
|
|
|
output = "curlhere.html"
|
|
|
|
user-agent = "superagent/1.0"
|
2021-11-20 00:09:51 +08:00
|
|
|
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
# and fetch another URL too
|
|
|
|
url = "example.com/docs/manpage.html"
|
|
|
|
-O
|
|
|
|
referer = "http://nowhereatall.example.com/"
|
|
|
|
# --- End of example file ---
|
2021-11-20 00:09:51 +08:00
|
|
|
|
2017-05-16 14:49:11 +08:00
|
|
|
When curl is invoked, it (unless --disable is used) checks for a default
|
2021-11-20 00:09:51 +08:00
|
|
|
config file and uses it if found, even when --config is used. The default
|
2021-09-03 14:19:33 +08:00
|
|
|
config file is checked for in the following places in this order:
|
2016-11-16 06:44:58 +08:00
|
|
|
|
2023-08-01 20:11:50 +08:00
|
|
|
1) **"$CURL_HOME/.curlrc"**
|
2020-08-22 05:40:12 +08:00
|
|
|
|
2023-08-01 20:11:50 +08:00
|
|
|
2) **"$XDG_CONFIG_HOME/curlrc"** (Added in 7.73.0)
|
2020-08-22 05:40:12 +08:00
|
|
|
|
2023-08-01 20:11:50 +08:00
|
|
|
3) **"$HOME/.curlrc"**
|
2020-08-22 05:40:12 +08:00
|
|
|
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
4) Windows: **"%USERPROFILE%\.curlrc"**
|
2020-08-22 05:40:12 +08:00
|
|
|
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
5) Windows: **"%APPDATA%\.curlrc"**
|
2020-08-22 05:40:12 +08:00
|
|
|
|
docs/cmdline: change to .md for cmdline docs
- switch all invidual files documenting command line options into .md,
as the documentation is now markdown-looking.
- made the parser treat 4-space indents as quotes
- switch to building the curl.1 manpage using the "mainpage.idx" file,
which lists the files to include to generate it, instead of using the
previous page-footer/headers. Also, those files are now also .md
ones, using the same format. I gave them underscore prefixes to make
them sort separately:
_NAME.md, _SYNOPSIS.md, _DESCRIPTION.md, _URL.md, _GLOBBING.md,
_VARIABLES.md, _OUTPUT.md, _PROTOCOLS.md, _PROGRESS.md, _VERSION.md,
_OPTIONS.md, _FILES.md, _ENVIRONMENT.md, _PROXYPREFIX.md,
_EXITCODES.md, _BUGS.md, _AUTHORS.md, _WWW.md, _SEEALSO.md
- updated test cases accordingly
Closes #12751
2024-01-21 06:18:43 +08:00
|
|
|
6) Windows: **"%USERPROFILE%\Application Data\.curlrc"**
|
2016-11-16 06:44:58 +08:00
|
|
|
|
2022-02-04 06:07:53 +08:00
|
|
|
7) Non-Windows: use getpwuid to find the home directory
|
2016-11-16 06:44:58 +08:00
|
|
|
|
2023-08-01 20:11:50 +08:00
|
|
|
8) On Windows, if it finds no *.curlrc* file in the sequence described above, it
|
2024-02-27 17:35:28 +08:00
|
|
|
checks for one in the same directory the curl executable is placed.
|
2016-11-16 06:44:58 +08:00
|
|
|
|
2023-08-01 20:11:50 +08:00
|
|
|
On Windows two filenames are checked per location: *.curlrc* and *_curlrc*,
|
|
|
|
preferring the former. Older versions on Windows checked for *_curlrc* only.
|