From 5c9488fc13e8d7793c9c3e5e09e5bc87b90bed2c Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Fri, 14 Aug 2015 23:42:00 -0400 Subject: [PATCH] Prevent the use of --output-file when downloading multiple files --- main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.cpp b/main.cpp index 411373e..b8df4a5 100644 --- a/main.cpp +++ b/main.cpp @@ -336,6 +336,12 @@ int main(int argc, char *argv[]) if (i->compare(0, GlobalConstants::PROTOCOL_PREFIX.length(), GlobalConstants::PROTOCOL_PREFIX) == 0) config.sFileIdString = *i; + if (!config.sOutputFilename.empty() && config.sFileIdString.find(',') != std::string::npos) + { + std::cerr << "Cannot specify an output file name when downloading multiple files." << std::endl; + return 1; + } + // Override cover option if (bNoCover) config.bCover = false;