curl: use errorf() better

Change series of error outputs to use errorf().

Only errors that are due to mistakes in command line option usage should
use helpf(), other types of errors in the tool should rather use
errorf().

Closes #4691
This commit is contained in:
Daniel Stenberg 2019-12-09 16:15:37 +01:00
parent 9819984fbb
commit c6deecd7e9
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 17 additions and 16 deletions

View file

@ -105,9 +105,9 @@ void warnf(struct GlobalConfig *config, const char *fmt, ...)
va_end(ap);
}
/*
* Emit help formatted message on given stream.
* Emit help formatted message on given stream. This is for errors with or
* related to command line arguments.
*/
void helpf(FILE *errors, const char *fmt, ...)
{
if(fmt) {
@ -125,7 +125,8 @@ void helpf(FILE *errors, const char *fmt, ...)
}
/*
* Emit error message on error stream if not muted.
* Emit error message on error stream if not muted. When errors are not tied
* to command line arguments, use helpf() for such errors.
*/
void errorf(struct GlobalConfig *config, const char *fmt, ...)
{