| 130 | } |
| 131 | |
| 132 | int Params::getopt(int argc, char* const argv[]) { |
| 133 | int rc = Util::Getopt::getopt(argc, argv, optstring_); |
| 134 | // Further consistency checks |
| 135 | if (!help_) { |
| 136 | if (rc == 0 && read_.empty()) { |
| 137 | std::cerr << progname() << ": Read and write files must be specified\n"; |
| 138 | rc = 1; |
| 139 | } |
| 140 | if (rc == 0 && write_.empty()) { |
| 141 | std::cerr << progname() << ": Write file must be specified\n"; |
| 142 | rc = 1; |
| 143 | } |
| 144 | if (preserve_ && iptc_ && exif_ && comment_ && xmp_) { |
| 145 | std::cerr << progname() << ": Option -p has no effect when all metadata types are specified.\n"; |
| 146 | rc = 1; |
| 147 | } |
| 148 | } |
| 149 | return rc; |
| 150 | } // Params::getopt |
| 151 | |
| 152 | void Params::usage(std::ostream& os) const { |
| 153 | os << "\nReads and writes raw metadata. Use -h option for help.\n" |