diff options
author | Daniel Stenberg <daniel@haxx.se> | 2015-08-25 09:20:56 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2015-08-25 09:20:56 +0200 |
commit | 4a889441d318f9133dc9f3eba1939e360a8f7d58 (patch) | |
tree | 70eb52fd977b67edad237e758c6a4818f0beec48 /src/tool_helpers.c | |
parent | ce034356d2fc9ac94bca4959a4054169129bf5d8 (diff) | |
download | curl-4a889441d318f9133dc9f3eba1939e360a8f7d58.tar.gz |
curl: point out the conflicting HTTP methods if used
It isn't always clear to the user which options that cause the HTTP
methods to conflict so by spelling them out it should hopefully be
easier to understand why curl complains.
Diffstat (limited to 'src/tool_helpers.c')
-rw-r--r-- | src/tool_helpers.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/tool_helpers.c b/src/tool_helpers.c index 08248c37c..2f74dc133 100644 --- a/src/tool_helpers.c +++ b/src/tool_helpers.c @@ -69,13 +69,23 @@ const char *param2text(int res) int SetHTTPrequest(struct OperationConfig *config, HttpReq req, HttpReq *store) { + /* this mirrors the HttpReq enum in tool_sdecls.h */ + const char *reqname[]= { + "", /* unspec */ + "GET (-G, --get)", + "HEAD (-I, --head)", + "multipart formpost (-F, --form)", + "POST (-d, --data)" + }; + if((*store == HTTPREQ_UNSPEC) || (*store == req)) { *store = req; return 0; } - - warnf(config->global, "You can only select one HTTP request method!\n"); + warnf(config->global, "You can only select one HTTP request method! " + "You asked for both %s and %s.\n", + reqname[req], reqname[*store]); return 1; } |