]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_getparam: make --show-headers the same as --include
authorDaniel Stenberg <daniel@haxx.se>
Wed, 10 Jul 2024 14:30:17 +0000 (16:30 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 3 Aug 2024 17:56:57 +0000 (19:56 +0200)
Simply a name alias that better explains what the option does.

Closes #13987

docs/cmdline-opts/Makefile.inc
docs/cmdline-opts/include.md [deleted file]
docs/cmdline-opts/show-headers.md [new file with mode: 0644]
docs/options-in-versions
src/tool_getparam.c
src/tool_listhelp.c
tests/data/test1461
tests/test1139.pl

index 75178b28a85df488ecdb46d620c11a86b1c22dcd..963da4eae1a65da6a8b421e40d02a8f94018337c 100644 (file)
@@ -134,7 +134,6 @@ DPAGES = \
   http3.md \
   http3-only.md \
   ignore-content-length.md \
-  include.md \
   insecure.md \
   interface.md \
   ip-tos.md \
@@ -252,6 +251,7 @@ DPAGES = \
   sasl-ir.md \
   service-name.md \
   show-error.md \
+  show-headers.md \
   silent.md \
   socks4.md \
   socks4a.md \
diff --git a/docs/cmdline-opts/include.md b/docs/cmdline-opts/include.md
deleted file mode 100644 (file)
index e487991..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
----
-c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
-SPDX-License-Identifier: curl
-Long: include
-Short: i
-Help: Include response headers in output
-Protocols: HTTP FTP
-Category: important verbose
-Added: 4.8
-Multi: boolean
-See-also:
-  - verbose
-Example:
-  - -i $URL
----
-
-# `--include`
-
-Include response headers in the output. HTTP response headers can include
-things like server name, cookies, date of the document, HTTP version and
-more... With non-HTTP protocols, the "headers" are other server communication.
-
-To view the request headers, consider the --verbose option.
diff --git a/docs/cmdline-opts/show-headers.md b/docs/cmdline-opts/show-headers.md
new file mode 100644 (file)
index 0000000..126610f
--- /dev/null
@@ -0,0 +1,29 @@
+---
+c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
+SPDX-License-Identifier: curl
+Long: show-headers
+Short: i
+Help: Show response headers in output
+Protocols: HTTP FTP
+Category: important verbose output
+Added: 4.8
+Multi: boolean
+See-also:
+  - verbose
+Example:
+  - -i $URL
+---
+
+# `--show-headers`
+
+Show response headers in the output. HTTP response headers can include things
+like server name, cookies, date of the document, HTTP version and more. With
+non-HTTP protocols, the "headers" are other server communication.
+
+To view the request headers, consider the --verbose option.
+
+Prior to 7.75.0 curl did not print the headers if --fail was used in
+combination with this option and there was error reported by server.
+
+This option was called --include before 8.10.0. The previous name remains
+functional.
index e19965e6a41b60242541cb6846c68889e408ed92..e53935ccb6a582635b7670d54ee76b6b3b712e2b 100644 (file)
 --ignore-content-length              7.14.1
 --ip-tos                             8.9.0
 --ipfs-gateway                       8.4.0
---include (-i)                       4.8
 --insecure (-k)                      7.10
 --interface                          7.3
 --ipv4 (-4)                          7.10.8
 --sasl-ir                            7.31.0
 --service-name                       7.43.0
 --show-error (-S)                    5.9
+--show-headers (-i)                  4.8
 --silent (-s)                        4.0
 --socks4                             7.15.2
 --socks4a                            7.18.0
index ae5dec9a16b71c2b315cbf29d5de85483b120e4d..eaa00e2068a37cb2bd44f66203a22557f7cbab1d 100644 (file)
@@ -286,6 +286,7 @@ typedef enum {
   C_SERVICE_NAME,
   C_SESSIONID,
   C_SHOW_ERROR,
+  C_SHOW_HEADERS,
   C_SILENT,
   C_SOCKS4,
   C_SOCKS4A,
@@ -458,7 +459,7 @@ static const struct LongShort aliases[]= {
   {"http3",                      ARG_NONE, ' ', C_HTTP3},
   {"http3-only",                 ARG_NONE, ' ', C_HTTP3_ONLY},
   {"ignore-content-length",      ARG_BOOL, ' ', C_IGNORE_CONTENT_LENGTH},
-  {"include",                    ARG_BOOL, 'i', C_INCLUDE},
+  {"include",                    ARG_BOOL, ' ', C_INCLUDE},
   {"insecure",                   ARG_BOOL, 'k', C_INSECURE},
   {"interface",                  ARG_STRG, ' ', C_INTERFACE},
   {"ip-tos",                     ARG_STRG, ' ', C_IP_TOS},
@@ -574,6 +575,7 @@ static const struct LongShort aliases[]= {
   {"service-name",               ARG_STRG, ' ', C_SERVICE_NAME},
   {"sessionid",                  ARG_BOOL, ' ', C_SESSIONID},
   {"show-error",                 ARG_BOOL, 'S', C_SHOW_ERROR},
+  {"show-headers",               ARG_BOOL, 'i', C_SHOW_HEADERS},
   {"silent",                     ARG_BOOL, 's', C_SILENT},
   {"socks4",                     ARG_STRG, ' ', C_SOCKS4},
   {"socks4a",                    ARG_STRG, ' ', C_SOCKS4A},
@@ -2492,6 +2494,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
       }
       break;
     case C_INCLUDE: /* --include */
+    case C_SHOW_HEADERS: /* --show-headers */
       config->show_headers = toggle; /* show the headers as well in the
                                         general output stream */
       break;
index 4095d4aa3d49826177b5dd78ff2b3e67dd0b0154..d87beae6d259779bd7c5e886b61b45fd6956c0bf 100644 (file)
@@ -302,9 +302,6 @@ const struct helptxt helptext[] = {
   {"    --ignore-content-length",
    "Ignore the size of the remote resource",
    CURLHELP_HTTP | CURLHELP_FTP},
-  {"-i, --include",
-   "Include response headers in output",
-   CURLHELP_IMPORTANT | CURLHELP_VERBOSE},
   {"-k, --insecure",
    "Allow insecure server connections",
    CURLHELP_TLS | CURLHELP_SFTP | CURLHELP_SCP | CURLHELP_SSH},
@@ -659,6 +656,9 @@ const struct helptxt helptext[] = {
   {"-S, --show-error",
    "Show error even when -s is used",
    CURLHELP_CURL | CURLHELP_GLOBAL},
+  {"-i, --show-headers",
+   "Show response headers in output",
+   CURLHELP_IMPORTANT | CURLHELP_VERBOSE | CURLHELP_OUTPUT},
   {"-s, --silent",
    "Silent mode",
    CURLHELP_IMPORTANT | CURLHELP_VERBOSE},
index 669e5fbf45cfafbb51149ba39df9da43bd903986..b1544ff5b346fd60ba2c2c187acc8c3f91065220 100644 (file)
@@ -35,9 +35,9 @@ Usage: curl [options...] <url>
  -d, --data <data>           HTTP POST data
  -f, --fail                  Fail fast with no output on HTTP errors
  -h, --help <category>       Get help for commands
- -i, --include               Include response headers in output
  -o, --output <file>         Write to file instead of stdout
  -O, --remote-name           Write output to file named as remote file
+ -i, --show-headers          Show response headers in output
  -s, --silent                Silent mode
  -T, --upload-file <file>    Transfer local FILE to destination
  -u, --user <user:password>  Server user and password
index 421af70b887b7d461d1a675c40269781eba16a4d..6ecab78ecee1cc86186bcb1750593283dda08dc7 100755 (executable)
@@ -177,6 +177,7 @@ my %opts = (
     '--krb4' => 6,
     '--ftp-ssl' => 6,
     '--ftp-ssl-reqd' => 6,
+    '--include' => 6,
 
     # for tests and debug only, can remain hidden
     '--test-event' => 6,