config.d 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. Long: config
  2. Arg: <file>
  3. Help: Read config from a file
  4. Short: K
  5. Category: curl
  6. Example: --config file.txt $URL
  7. ---
  8. Specify a text file to read curl arguments from. The command line arguments
  9. found in the text file will be used as if they were provided on the command
  10. line.
  11. Options and their parameters must be specified on the same line in the file,
  12. separated by whitespace, colon, or the equals sign. Long option names can
  13. optionally be given in the config file without the initial double dashes and
  14. if so, the colon or equals characters can be used as separators. If the option
  15. is specified with one or two dashes, there can be no colon or equals character
  16. between the option and its parameter.
  17. If the parameter contains whitespace (or starts with : or =), the parameter
  18. must be enclosed within quotes. Within double quotes, the following escape
  19. sequences are available: \\\\, \\", \\t, \\n, \\r and \\v. A backslash
  20. preceding any other letter is ignored.
  21. If the first column of a config line is a '#' character, the rest of the line
  22. will be treated as a comment.
  23. Only write one option per physical line in the config file.
  24. Specify the filename to --config as '-' to make curl read the file from stdin.
  25. Note that to be able to specify a URL in the config file, you need to specify
  26. it using the --url option, and not by simply writing the URL on its own
  27. line. So, it could look similar to this:
  28. url = "https://curl.se/docs/"
  29. When curl is invoked, it (unless --disable is used) checks for a default
  30. config file and uses it if found, even when this option is used. The default
  31. config file is checked for in the following places in this order:
  32. 1) Use the CURL_HOME environment variable if set
  33. 2) Use the XDG_CONFIG_HOME environment variable if set (Added in 7.73.0)
  34. 3) Use the HOME environment variable if set
  35. 4) Non-windows: use getpwuid to find the home directory
  36. 5) Windows: use APPDATA if set
  37. 6) Windows: use "USERPROFILE\\Application Data" if set
  38. 7) On windows, if there is no .curlrc file in the home dir, it checks for one
  39. in the same dir the curl executable is placed. On Unix-like systems, it will
  40. simply try to load .curlrc from the determined home dir.
  41. .nf
  42. # --- Example file ---
  43. # this is a comment
  44. url = "example.com"
  45. output = "curlhere.html"
  46. user-agent = "superagent/1.0"
  47. # and fetch another URL too
  48. url = "example.com/docs/manpage.html"
  49. -O
  50. referer = "http://nowhereatall.example.com/"
  51. # --- End of example file ---
  52. .fi
  53. This option can be used multiple times to load multiple config files.