[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 18/163: curl: added --styled-output
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 18/163: curl: added --styled-output |
Date: |
Sun, 05 Aug 2018 12:35:44 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit f3d836b73601fc6d14cb917e1cd72f43b9056dff
Author: Daniel Stenberg <address@hidden>
AuthorDate: Thu May 17 14:09:17 2018 +0200
curl: added --styled-output
It is enabled by default, so --no-styled-output will switch off the
detection/use of bold headers.
Closes #2538
---
docs/cmdline-opts/Makefile.inc | 3 ++-
docs/cmdline-opts/styled-output.d | 6 ++++++
src/tool_cb_hdr.c | 2 +-
src/tool_cfgable.h | 1 +
src/tool_getparam.c | 7 +++++--
src/tool_help.c | 2 ++
src/tool_main.c | 3 ++-
7 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/docs/cmdline-opts/Makefile.inc b/docs/cmdline-opts/Makefile.inc
index 778149ca3..fb56d2552 100644
--- a/docs/cmdline-opts/Makefile.inc
+++ b/docs/cmdline-opts/Makefile.inc
@@ -46,6 +46,7 @@ DPAGES = abstract-unix-socket.d anyauth.d append.d basic.d
cacert.d capath.d cer
tlsauthtype.d tlspassword.d tlsuser.d tlsv1.0.d tlsv1.1.d tlsv1.2.d \
tlsv1.3.d tlsv1.d trace-ascii.d trace.d trace-time.d tr-encoding.d \
unix-socket.d upload-file.d url.d use-ascii.d user-agent.d user.d \
- verbose.d version.d write-out.d xattr.d request-target.d
+ verbose.d version.d write-out.d xattr.d request-target.d \
+ styled-output.d
OTHERPAGES = page-footer page-header
diff --git a/docs/cmdline-opts/styled-output.d
b/docs/cmdline-opts/styled-output.d
new file mode 100644
index 000000000..e4751aecb
--- /dev/null
+++ b/docs/cmdline-opts/styled-output.d
@@ -0,0 +1,6 @@
+Long: styled-output
+Help: Enable styled output for HTTP headers
+Added: 7.61.0
+---
+Enables the automatic use of bold font styles when writing HTTP headers to the
+terminal. Use --no-styled-output to switch them off.
diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c
index 4e9e49a6d..88ce5e13b 100644
--- a/src/tool_cb_hdr.c
+++ b/src/tool_cb_hdr.c
@@ -163,7 +163,7 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb,
void *userdata)
if(!outs->stream && !tool_create_output_file(outs, FALSE))
return failure;
- if(hdrcbdata->global->isatty)
+ if(hdrcbdata->global->isatty && hdrcbdata->global->styled_output)
value = memchr(ptr, ':', cb);
if(value) {
size_t namelen = value - ptr;
diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h
index 3bd908879..9d995f85e 100644
--- a/src/tool_cfgable.h
+++ b/src/tool_cfgable.h
@@ -276,6 +276,7 @@ struct GlobalConfig {
int progressmode; /* CURL_PROGRESS_BAR / CURL_PROGRESS_STATS */
char *libcurl; /* Output libcurl code to this file name */
bool fail_early; /* exit on first transfer error */
+ bool styled_output; /* enable fancy output style detection */
struct OperationConfig *first;
struct OperationConfig *current;
struct OperationConfig *last; /* Always last in the struct */
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index 60a88e266..4b9ae0653 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -260,6 +260,7 @@ static const struct LongShort aliases[]= {
{"EB", "socks5-gssapi", ARG_BOOL},
{"f", "fail", ARG_BOOL},
{"fa", "fail-early", ARG_BOOL},
+ {"fb", "styled-output", ARG_BOOL},
{"F", "form", ARG_STRING},
{"Fs", "form-string", ARG_STRING},
{"g", "globoff", ARG_BOOL},
@@ -1643,8 +1644,10 @@ ParameterError getparameter(const char *flag, /* f or
-long-flag */
case 'a': /* --fail-early */
global->fail_early = toggle;
break;
- default:
- /* fail hard on errors */
+ case 'b': /* --styled-output */
+ global->styled_output = toggle;
+ break;
+ default: /* --fail (hard on errors) */
config->failonerror = toggle;
}
break;
diff --git a/src/tool_help.c b/src/tool_help.c
index 71862511f..7c4dda3b0 100644
--- a/src/tool_help.c
+++ b/src/tool_help.c
@@ -414,6 +414,8 @@ static const struct helptxt helptext[] = {
"Use SSLv3"},
{" --stderr",
"Where to redirect stderr"},
+ {" --styled-output",
+ "Enable styled output for HTTP headers"},
{" --suppress-connect-headers",
"Suppress proxy CONNECT response headers"},
{" --tcp-fastopen",
diff --git a/src/tool_main.c b/src/tool_main.c
index 4e78d3321..b9f7eae2c 100644
--- a/src/tool_main.c
+++ b/src/tool_main.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2017, Daniel Stenberg, <address@hidden>, et al.
+ * Copyright (C) 1998 - 2018, Daniel Stenberg, <address@hidden>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -147,6 +147,7 @@ static CURLcode main_init(struct GlobalConfig *config)
/* Initialise the global config */
config->showerror = -1; /* Will show errors */
config->errors = stderr; /* Default errors to stderr */
+ config->styled_output = TRUE; /* enable detection */
/* Allocate the initial operate config */
config->first = config->last = malloc(sizeof(struct OperationConfig));
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 15/163: configure: replace AC_TRY_RUN with CURL_RUN_IFELSE, (continued)
- [GNUnet-SVN] [gnurl] 15/163: configure: replace AC_TRY_RUN with CURL_RUN_IFELSE, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 23/163: schannel: make CAinfo parsing resilient to CR/LF, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 35/163: schannel: add failf calls for client certificate failures, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 25/163: tftp: make sure error is zero terminated before printfing it, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 06/163: bump: start working on the pending 7.61.0, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 20/163: KNOWN_BUGS: mention the -O with %-encoded file names, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 22/163: CURLOPT_ACCEPT_ENCODING.3: add brotli and clarify a bit, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 11/163: docs: mention HAproxy protocol "version 1", gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 16/163: configure: compile-time SIZEOF checks, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 34/163: winbuild: In MakefileBuild.vc fix typo DISTDIR->DIRDIST, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 18/163: curl: added --styled-output,
gnunet <=
- [GNUnet-SVN] [gnurl] 14/163: docs: clarify CURLOPT_HTTPGET somewhat, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 24/163: configure: add missing m4/ax_compile_check_sizeof.m4, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 21/163: RELEASE-NOTES: synced, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 28/163: cmake: set -d postfix for debug builds if not specified using -DCMAKE_DEBUG_POSTFIX explicitly, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 53/163: os400: sync EBCDIC wrappers and ILE/RPG binding with latest options, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 32/163: content_encoding: handle zlib versions too old for Z_BLOCK, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 38/163: mailmap: Max Savenkov, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 31/163: multi: provide a socket to wait for in Curl_protocol_getsock, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 41/163: cmdline-opts/gen.pl: warn if mutexes: or see-also: list non-existing options, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 44/163: configure: fix ssh2 linking when built with a static mbedtls, gnunet, 2018/08/05