config.d 2.4 KB

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