From 2de045ff7c56083930efda2a24eb8c5abf41c1b0 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Fri, 14 Feb 2014 22:05:27 +0000 Subject: tool_operate: Changed the required argument check/get to be upfront Rather than check for required arguments, and prompt for any host and proxy passwords, as each operation is performed, changed the code so all configurations are checked before any operations are performed. This allows the user to input all the required passwords, for example, upfront rather than wait for each operation. --- src/tool_operate.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/tool_operate.c b/src/tool_operate.c index fc54819ea..6e0715707 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -234,11 +234,6 @@ static int operate_do(struct Configurable *config) ** from outside of nested loops further down below. */ - /* Get the required aguments */ - res = get_args(config); - if(res) - goto quit_curl; - /* Check we have a url */ if(!config->url_list || !config->url_list->url) { helpf(config->errors, "no URL specified!\n"); @@ -1845,6 +1840,17 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[]) else { struct Configurable *operation = config; + /* Get the required aguments for each operation */ + while(!result && operation) { + result = get_args(operation); + + operation = operation->next; + } + + /* Reset the operation pointer */ + operation = config; + + /* Perform each operation */ while(!result && operation) { result = operate_do(operation); -- cgit v1.2.3