Index: utils/ofhttp/OFHTTP.m ================================================================== --- utils/ofhttp/OFHTTP.m +++ utils/ofhttp/OFHTTP.m @@ -53,11 +53,11 @@ { OFArray OF_GENERIC(OFString*) *_URLs; size_t _URLIndex; int _errorCode; OFString *_outputPath; - bool _continue, _detectFileName, _quiet, _verbose; + bool _continue, _force, _detectFileName, _quiet, _verbose; OFDataArray *_body; of_http_request_method_t _method; OFMutableDictionary *_clientHeaders; OFHTTPClient *_HTTPClient; char *_buffer; @@ -81,10 +81,12 @@ @"\nOptions:\n " @"-b --body " @" Specify the file to send as body\n " @"-c --continue " @" Continue download of existing file\n " + @"-f --force " + @" Force / overwrite existing file\n " @"-h --help " @" Show this help\n " @"-H --header " @" Add a header (e.g. X-Foo:Bar)\n " @"-m --method " @@ -225,10 +227,11 @@ { OFString *outputPath; const of_options_parser_option_t options[] = { { 'b', @"body", 1, NULL, NULL }, { 'c', @"continue", 0, &_continue, NULL }, + { 'f', @"force", 0, &_force, NULL }, { 'h', @"help", 0, NULL, NULL }, { 'H', @"header", 1, NULL, NULL }, { 'm', @"method", 1, NULL, NULL }, { 'o', @"output", 1, NULL, &outputPath }, { 'O', @"detect-filename", 0, &_detectFileName, NULL }, @@ -750,11 +753,12 @@ } if ([_outputPath isEqual: @"-"]) _output = of_stdout; else { - if (!_continue && [fileManager fileExistsAtPath: fileName]) { + if (!_continue && !_force && + [fileManager fileExistsAtPath: fileName]) { [of_stderr writeFormat: @"%@: File %@ already exists!\n", [OFApplication programName], fileName]; _errorCode = 1;