aboutsummaryrefslogtreecommitdiff
path: root/src/tool_operate.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-02-14 22:05:27 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-02-15 18:59:12 +0000
commit2de045ff7c56083930efda2a24eb8c5abf41c1b0 (patch)
tree99d07ecd5c9b32672a21ca769c1ea73d2db2ceed /src/tool_operate.c
parentf80ca7a05a2affce7b02f618592981aa02e61ce7 (diff)
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.
Diffstat (limited to 'src/tool_operate.c')
-rw-r--r--src/tool_operate.c16
1 files 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);