aboutsummaryrefslogtreecommitdiff
path: root/src/tool_operate.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-02-06 19:31:44 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-02-06 19:40:41 +0000
commitdd97828df70344c0cda642135c2b35756d9568c0 (patch)
treebf6c7e4a2b0fd1778022f770d05fe1576b946701 /src/tool_operate.c
parent5204b45ff9973e93b94019c652fb7d50e3cf97f1 (diff)
tool_operate: Moved argument parsing into operate()
Diffstat (limited to 'src/tool_operate.c')
-rw-r--r--src/tool_operate.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 5a4afffc6..0a867244f 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -235,17 +235,6 @@ static int operate_do(struct Configurable *config, int argc,
** from outside of nested loops further down below.
*/
- /* Parse the command line arguments */
- res = parse_args(config, argc, argv);
- if(res) {
- if(res != PARAM_HELP_REQUESTED)
- res = CURLE_FAILED_INIT;
- else
- res = CURLE_OK;
-
- goto quit_curl;
- }
-
if(config->userpwd && !config->xoauth2_bearer) {
res = checkpasswd("host", &config->userpwd);
if(res)
@@ -1855,9 +1844,19 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
}
}
- if(!result)
+ if(!result) {
+ /* Parse the command line arguments */
+ ParameterError res = parse_args(config, argc, argv);
+ if(res) {
+ if(res != PARAM_HELP_REQUESTED)
+ result = CURLE_FAILED_INIT;
+ else
+ result = CURLE_OK;
+ }
/* Perform the main operation */
- result = operate_do(config, argc, argv);
+ else
+ result = operate_do(config, argc, argv);
+ }
/* Perform the cleanup */
operate_free(config);