MCPcopy Create free account
hub / github.com/Exiv2/exiv2 / getopt

Method getopt

samples/metacopy.cpp:132–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132int 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
152void Params::usage(std::ostream& os) const {
153 os << "\nReads and writes raw metadata. Use -h option for help.\n"

Callers 1

mainFunction · 0.45

Calls 2

getoptFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected