config.d 2.4 KB

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