summaryrefslogtreecommitdiff
path: root/src/tool_msgs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tool_msgs.c')
-rw-r--r--src/tool_msgs.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/tool_msgs.c b/src/tool_msgs.c
index 48c724940..c0e85aee6 100644
--- a/src/tool_msgs.c
+++ b/src/tool_msgs.c
@@ -32,6 +32,7 @@
#define WARN_PREFIX "Warning: "
#define NOTE_PREFIX "Note: "
+#define ERROR_PREFIX "curl: "
static void voutf(struct GlobalConfig *config,
const char *prefix,
@@ -122,3 +123,16 @@ void helpf(FILE *errors, const char *fmt, ...)
#endif
"for more information\n");
}
+
+/*
+ * Emit error message on error stream if not muted.
+ */
+void errorf(struct GlobalConfig *config, const char *fmt, ...)
+{
+ if(!config->mute) {
+ va_list ap;
+ va_start(ap, fmt);
+ voutf(config, ERROR_PREFIX, fmt, ap);
+ va_end(ap);
+ }
+}