Fixed handling of multiple rename options -r, -t, -T
This commit is contained in:
parent
f437441783
commit
623f52e185
@ -334,16 +334,23 @@ int Params::evalRename(int opt, const std::string& optarg)
|
||||
case Action::none:
|
||||
action_ = Action::rename;
|
||||
switch (opt) {
|
||||
case 'r': format_ = optarg; break;
|
||||
case 'r':
|
||||
format_ = optarg;
|
||||
formatSet_ = true;
|
||||
break;
|
||||
case 't': timestamp_ = true; break;
|
||||
case 'T': timestampOnly_ = true; break;
|
||||
}
|
||||
break;
|
||||
case Action::rename:
|
||||
if (opt == 'r' && !format_.empty()) {
|
||||
if (opt == 'r' && (formatSet_ || timestampOnly_)) {
|
||||
std::cerr << progname()
|
||||
<< ": " << _("Ignoring surplus option") << " -r \"" << optarg << "\"\n";
|
||||
}
|
||||
else {
|
||||
format_ = optarg;
|
||||
formatSet_ = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
std::cerr << progname()
|
||||
|
||||
@ -164,6 +164,7 @@ public:
|
||||
|
||||
long adjustment_; //!< Adjustment in seconds.
|
||||
std::string format_; //!< Filename format (-r option arg).
|
||||
bool formatSet_; //!< Whether the format is set with -r
|
||||
CmdFiles cmdFiles_; //!< Names of the modification command files
|
||||
CmdLines cmdLines_; //!< Commands from the command line
|
||||
ModifyCmds modifyCmds_; //!< Parsed modification commands
|
||||
@ -195,6 +196,7 @@ private:
|
||||
target_(ctExif|ctIptc|ctComment),
|
||||
adjustment_(0),
|
||||
format_("%Y%m%d_%H%M%S"),
|
||||
formatSet_(false),
|
||||
first_(true) {}
|
||||
|
||||
//! Prevent copy-construction: not implemented.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user