| 1253 | } // parsePreviewNumbers |
| 1254 | |
| 1255 | bool parseCmdFiles(ModifyCmds& modifyCmds, const Params::CmdFiles& cmdFiles) { |
| 1256 | for (auto&& filename : cmdFiles) { |
| 1257 | try { |
| 1258 | std::ifstream file(filename.c_str()); |
| 1259 | bool bStdin = filename == "-"; |
| 1260 | if (!file && !bStdin) { |
| 1261 | std::cerr << filename << ": " << _("Failed to open command file for reading\n"); |
| 1262 | return false; |
| 1263 | } |
| 1264 | int num = 0; |
| 1265 | std::string line; |
| 1266 | while (bStdin ? std::getline(std::cin, line) : std::getline(file, line)) { |
| 1267 | ModifyCmd modifyCmd; |
| 1268 | if (parseLine(modifyCmd, line, ++num)) { |
| 1269 | modifyCmds.push_back(std::move(modifyCmd)); |
| 1270 | } |
| 1271 | } |
| 1272 | } catch (const Exiv2::Error& error) { |
| 1273 | std::cerr << filename << ", " << _("line") << " " << error << "\n"; |
| 1274 | return false; |
| 1275 | } |
| 1276 | } |
| 1277 | return true; |
| 1278 | } // parseCmdFile |
| 1279 | |
| 1280 | bool parseCmdLines(ModifyCmds& modifyCmds, const Params::CmdLines& cmdLines) { |
| 1281 | try { |