tool_getparam: make --show-headers the same as --include

Simply a name alias that better explains what the option does.

Closes #13987
This commit is contained in:
Daniel Stenberg 2024-07-10 16:30:17 +02:00
Родитель 709a6a3965
Коммит 82c53f821f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 5CC908FDB71E12C2
8 изменённых файлов: 40 добавлений и 30 удалений

Просмотреть файл

@ -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 \

Просмотреть файл

@ -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.

Просмотреть файл

@ -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.

Просмотреть файл

@ -101,7 +101,6 @@
--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
@ -217,6 +216,7 @@
--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

Просмотреть файл

@ -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;

Просмотреть файл

@ -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},

Просмотреть файл

@ -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

Просмотреть файл

@ -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,