From 4a889441d318f9133dc9f3eba1939e360a8f7d58 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 25 Aug 2015 09:20:56 +0200 Subject: 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. --- src/tool_helpers.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/tool_helpers.c') 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; } -- cgit v1.2.3