Fix bugs in cli

This commit is contained in:
Martchus 2016-06-25 23:11:16 +02:00
parent 0e488ddcd2
commit f394dcb46b
3 changed files with 170 additions and 167 deletions

View File

@ -103,7 +103,7 @@ SetTagInfoArgs::SetTagInfoArgs(Argument &filesArg, Argument &verboseArg) :
valuesArg.setRequiredValueCount(-1); valuesArg.setRequiredValueCount(-1);
valuesArg.setImplicit(true); valuesArg.setImplicit(true);
setTagInfoArg.setDenotesOperation(true); setTagInfoArg.setDenotesOperation(true);
setTagInfoArg.setCallback(std::bind(Cli::setTagInfo, _1, std::cref(*this))); setTagInfoArg.setCallback(std::bind(Cli::setTagInfo, std::cref(*this)));
setTagInfoArg.setSubArguments({&valuesArg, &filesArg, &docTitleArg, &removeOtherFieldsArg, &treatUnknownFilesAsMp3FilesArg, &id3v1UsageArg, &id3v2UsageArg, setTagInfoArg.setSubArguments({&valuesArg, &filesArg, &docTitleArg, &removeOtherFieldsArg, &treatUnknownFilesAsMp3FilesArg, &id3v1UsageArg, &id3v2UsageArg,
&mergeMultipleSuccessiveTagsArg, &id3v2VersionArg, &encodingArg, &removeTargetsArg, &attachmentsArg, &mergeMultipleSuccessiveTagsArg, &id3v2VersionArg, &encodingArg, &removeTargetsArg, &attachmentsArg,
&removeExistingAttachmentsArg, &minPaddingArg, &maxPaddingArg, &prefPaddingArg, &tagPosArg, &removeExistingAttachmentsArg, &minPaddingArg, &maxPaddingArg, &prefPaddingArg, &tagPosArg,
@ -155,7 +155,7 @@ int main(int argc, char *argv[])
fieldsArg.setImplicit(true); fieldsArg.setImplicit(true);
Argument displayTagInfoArg("get", 'g', "displays the values of all specified tag fields (displays all fields if none specified)"); Argument displayTagInfoArg("get", 'g', "displays the values of all specified tag fields (displays all fields if none specified)");
displayTagInfoArg.setDenotesOperation(true); displayTagInfoArg.setDenotesOperation(true);
displayTagInfoArg.setCallback(std::bind(Cli::displayTagInfo, _1, std::cref(filesArg), std::cref(verboseArg))); displayTagInfoArg.setCallback(std::bind(Cli::displayTagInfo, std::cref(fieldsArg), std::cref(filesArg), std::cref(verboseArg)));
displayTagInfoArg.setSubArguments({&fieldsArg, &filesArg, &verboseArg}); displayTagInfoArg.setSubArguments({&fieldsArg, &filesArg, &verboseArg});
// set tag info // set tag info
Cli::SetTagInfoArgs setTagInfoArgs(filesArg, verboseArg); Cli::SetTagInfoArgs setTagInfoArgs(filesArg, verboseArg);
@ -167,7 +167,7 @@ int main(int argc, char *argv[])
Argument extractFieldArg("extract", 'e', "extracts the specified field from the specified file"); Argument extractFieldArg("extract", 'e', "extracts the specified field from the specified file");
extractFieldArg.setSubArguments({&fieldArg, &fileArg, &outputFileArg, &verboseArg}); extractFieldArg.setSubArguments({&fieldArg, &fileArg, &outputFileArg, &verboseArg});
extractFieldArg.setDenotesOperation(true); extractFieldArg.setDenotesOperation(true);
extractFieldArg.setCallback(std::bind(Cli::extractField, _1, std::cref(fileArg), std::cref(outputFileArg), std::cref(verboseArg))); extractFieldArg.setCallback(std::bind(Cli::extractField, std::cref(fieldsArg), std::cref(fileArg), std::cref(outputFileArg), std::cref(verboseArg)));
// file info // file info
Argument validateArg("validate", 'c', "validates the file integrity as accurately as possible; the structure of the file will be parsed completely"); Argument validateArg("validate", 'c', "validates the file integrity as accurately as possible; the structure of the file will be parsed completely");
validateArg.setCombinable(true); validateArg.setCombinable(true);

View File

@ -285,152 +285,152 @@ bool applyTargetConfiguration(TagTarget &target, const std::string &configStr)
} }
} }
vector<FieldDenotation> parseFieldDenotations(const std::vector<const char *> &fieldDenotations, bool readOnly) vector<FieldDenotation> parseFieldDenotations(const Argument &fieldsArg, bool readOnly)
{ {
vector<FieldDenotation> fields; vector<FieldDenotation> fields;
fields.reserve(fieldDenotations.size()); if(fieldsArg.isPresent()) {
TagType currentTagType = TagType::Unspecified; const vector<const char *> &fieldDenotations = fieldsArg.values();
TagTarget currentTagTarget; fields.reserve(fieldDenotations.size());
for(const char *fieldDenotationString : fieldDenotations) { TagType currentTagType = TagType::Unspecified;
// check for tag or target specifier TagTarget currentTagTarget;
const auto fieldDenotationLen = strlen(fieldDenotationString); for(const char *fieldDenotationString : fieldDenotations) {
if(strncmp(fieldDenotationString, "tag:", 4) == 0) { // check for tag or target specifier
if(fieldDenotationLen == 4) { const auto fieldDenotationLen = strlen(fieldDenotationString);
cerr << "Warning: The \"tag\"-specifier has been used with no value(s) and hence is ignored. Possible values are: id3,id3v1,id3v2,itunes,vorbis,matroska,all" << endl; if(!strncmp(fieldDenotationString, "tag:", 4)) {
} else { if(fieldDenotationLen == 4) {
TagType tagType = TagType::Unspecified; cerr << "Warning: The \"tag\"-specifier has been used with no value(s) and hence is ignored. Possible values are: id3,id3v1,id3v2,itunes,vorbis,matroska,all" << endl;
for(const auto &part : splitString(fieldDenotationString + 4, ",", EmptyPartsTreat::Omit)) { } else {
if(part == "id3v1") { TagType tagType = TagType::Unspecified;
tagType |= TagType::Id3v1Tag; for(const auto &part : splitString(fieldDenotationString + 4, ",", EmptyPartsTreat::Omit)) {
} else if(part == "id3v2") { if(part == "id3v1") {
tagType |= TagType::Id3v2Tag; tagType |= TagType::Id3v1Tag;
} else if(part == "id3") { } else if(part == "id3v2") {
tagType |= TagType::Id3v1Tag | TagType::Id3v2Tag; tagType |= TagType::Id3v2Tag;
} else if(part == "itunes" || part == "mp4") { } else if(part == "id3") {
tagType |= TagType::Mp4Tag; tagType |= TagType::Id3v1Tag | TagType::Id3v2Tag;
} else if(part == "vorbis") { } else if(part == "itunes" || part == "mp4") {
tagType |= TagType::VorbisComment; tagType |= TagType::Mp4Tag;
} else if(part == "matroska") { } else if(part == "vorbis") {
tagType |= TagType::MatroskaTag; tagType |= TagType::VorbisComment;
} else if(part == "all" || part == "any") { } else if(part == "matroska") {
tagType = TagType::Unspecified; tagType |= TagType::MatroskaTag;
break; } else if(part == "all" || part == "any") {
} else { tagType = TagType::Unspecified;
cerr << "Warning: The value provided with the \"tag\"-specifier is invalid and will be ignored. Possible values are: id3,id3v1,id3v2,itunes,vorbis,matroska,all" << endl; break;
tagType = currentTagType; } else {
break; cerr << "Warning: The value provided with the \"tag\"-specifier is invalid and will be ignored. Possible values are: id3,id3v1,id3v2,itunes,vorbis,matroska,all" << endl;
tagType = currentTagType;
break;
}
} }
currentTagType = tagType;
break;
} }
currentTagType = tagType; } else if(applyTargetConfiguration(currentTagTarget, fieldDenotationString)) {
break; continue;
} }
} else if(applyTargetConfiguration(currentTagTarget, fieldDenotationString)) { // read field name
continue; const auto equationPos = strchr(fieldDenotationString, '=');
} size_t fieldNameLen = equationPos ? static_cast<size_t>(equationPos - fieldDenotationString) : strlen(fieldDenotationString);
// read field name // field name might denote increment ("+") or path disclosure (">")
const auto equationPos = strchr(fieldDenotationString, '='); DenotationType type = DenotationType::Normal;
auto fieldName = equationPos ? string(fieldDenotationString, static_cast<size_t>(equationPos - fieldDenotationString)) : fieldDenotationString; if(fieldNameLen && equationPos) {
// field name might denote increment ("+") or path disclosure (">") switch(*(equationPos - 1)) {
auto fieldNamePos = fieldName.size(); case '+':
DenotationType type = DenotationType::Normal; type = DenotationType::Increment;
if(fieldNamePos) { --fieldNameLen;
switch(fieldName.at(--fieldNamePos)) { break;
case '+': case '>':
type = DenotationType::Increment; type = DenotationType::File;
--fieldNamePos; --fieldNameLen;
break; break;
case '>': default:
type = DenotationType::File; ;
--fieldNamePos; }
break;
default:
;
} }
} // field name might specify a file index
// field name might specify a file index unsigned int fileIndex = 0, mult = 1;
unsigned int fileIndex = 0, mult = 1; for(const char *digitPos = fieldDenotationString + fieldNameLen - 1; fieldNameLen && isDigit(*digitPos); --fieldNameLen, --digitPos, mult *= 10) {
for(; fieldNamePos != static_cast<string::size_type>(-1) && isDigit(fieldName.at(fieldNamePos)); --fieldNamePos, mult *= 10) { fileIndex += static_cast<unsigned int>(*digitPos - '0') * mult;
fileIndex += static_cast<unsigned int>(fieldName.at(fieldNamePos) - '0') * mult; }
} if(!fieldNameLen) {
if(fieldNamePos == static_cast<string::size_type>(-1)) { cerr << "Warning: Ignoring field denotation \"" << fieldDenotationString << "\" because no field name has been specified." << endl;
cerr << "Warning: Ignoring field denotation \"" << fieldDenotationString << "\" because no field name has been specified." << endl; continue;
continue; }
} else if(++fieldNamePos < fieldName.size()) { // parse the denoted filed
fieldName = string(fieldName, fieldNamePos); KnownField field;
} if(!strncmp(fieldDenotationString, "title", fieldNameLen)) {
// parse the denoted filed field = KnownField::Title;
KnownField field; } else if(!strncmp(fieldDenotationString, "album", fieldNameLen)) {
if(fieldName == "title") { field = KnownField::Album;
field = KnownField::Title; } else if(!strncmp(fieldDenotationString, "artist", fieldNameLen)) {
} else if(fieldName == "album") { field = KnownField::Artist;
field = KnownField::Album; } else if(!strncmp(fieldDenotationString, "genre", fieldNameLen)) {
} else if(fieldName == "artist") { field = KnownField::Genre;
field = KnownField::Artist; } else if(!strncmp(fieldDenotationString, "year", fieldNameLen)) {
} else if(fieldName == "genre") { field = KnownField::Year;
field = KnownField::Genre; } else if(!strncmp(fieldDenotationString, "comment", fieldNameLen)) {
} else if(fieldName == "year") { field = KnownField::Comment;
field = KnownField::Year; } else if(!strncmp(fieldDenotationString, "bpm", fieldNameLen)) {
} else if(fieldName == "comment") { field = KnownField::Bpm;
field = KnownField::Comment; } else if(!strncmp(fieldDenotationString, "bps", fieldNameLen)) {
} else if(fieldName == "bpm") { field = KnownField::Bps;
field = KnownField::Bpm; } else if(!strncmp(fieldDenotationString, "lyricist", fieldNameLen)) {
} else if(fieldName == "bps") { field = KnownField::Lyricist;
field = KnownField::Bps; } else if(!strncmp(fieldDenotationString, "track", fieldNameLen)) {
} else if(fieldName == "lyricist") { field = KnownField::TrackPosition;
field = KnownField::Lyricist; } else if(!strncmp(fieldDenotationString, "disk", fieldNameLen)) {
} else if(fieldName == "track") { field = KnownField::DiskPosition;
field = KnownField::TrackPosition; } else if(!strncmp(fieldDenotationString, "part", fieldNameLen)) {
} else if(fieldName == "disk") { field = KnownField::PartNumber;
field = KnownField::DiskPosition; } else if(!strncmp(fieldDenotationString, "totalparts", fieldNameLen)) {
} else if(fieldName == "part") { field = KnownField::TotalParts;
field = KnownField::PartNumber; } else if(!strncmp(fieldDenotationString, "encoder", fieldNameLen)) {
} else if(fieldName == "totalparts") { field = KnownField::Encoder;
field = KnownField::TotalParts; } else if(!strncmp(fieldDenotationString, "recorddate", fieldNameLen)) {
} else if(fieldName == "encoder") { field = KnownField::RecordDate;
field = KnownField::Encoder; } else if(!strncmp(fieldDenotationString, "performers", fieldNameLen)) {
} else if(fieldName == "recorddate") { field = KnownField::Performers;
field = KnownField::RecordDate; } else if(!strncmp(fieldDenotationString, "duration", fieldNameLen)) {
} else if(fieldName == "performers") { field = KnownField::Length;
field = KnownField::Performers; } else if(!strncmp(fieldDenotationString, "language", fieldNameLen)) {
} else if(fieldName == "duration") { field = KnownField::Language;
field = KnownField::Length; } else if(!strncmp(fieldDenotationString, "encodersettings", fieldNameLen)) {
} else if(fieldName == "language") { field = KnownField::EncoderSettings;
field = KnownField::Language; } else if(!strncmp(fieldDenotationString, "lyrics", fieldNameLen)) {
} else if(fieldName == "encodersettings") { field = KnownField::Lyrics;
field = KnownField::EncoderSettings; } else if(!strncmp(fieldDenotationString, "synchronizedlyrics", fieldNameLen)) {
} else if(fieldName == "lyrics") { field = KnownField::SynchronizedLyrics;
field = KnownField::Lyrics; } else if(!strncmp(fieldDenotationString, "grouping", fieldNameLen)) {
} else if(fieldName == "synchronizedlyrics") { field = KnownField::Grouping;
field = KnownField::SynchronizedLyrics; } else if(!strncmp(fieldDenotationString, "recordlabel", fieldNameLen)) {
} else if(fieldName == "grouping") { field = KnownField::RecordLabel;
field = KnownField::Grouping; } else if(!strncmp(fieldDenotationString, "cover", fieldNameLen)) {
} else if(fieldName == "recordlabel") { field = KnownField::Cover;
field = KnownField::RecordLabel; type = DenotationType::File; // read cover always from file
} else if(fieldName == "cover") { } else if(!strncmp(fieldDenotationString, "composer", fieldNameLen)) {
field = KnownField::Cover; field = KnownField::Composer;
type = DenotationType::File; // read cover always from file } else if(!strncmp(fieldDenotationString, "rating", fieldNameLen)) {
} else if(fieldName == "composer") { field = KnownField::Rating;
field = KnownField::Composer; } else if(!strncmp(fieldDenotationString, "description", fieldNameLen)) {
} else if(fieldName == "rating") { field = KnownField::Description;
field = KnownField::Rating;
} else if(fieldName == "description") {
field = KnownField::Description;
} else {
// no "KnownField" value matching -> discard the field denotation
cerr << "Warning: The field name \"" << fieldName << "\" is unknown and will be ingored." << endl;
continue;
}
// add field denotation with parsed values
fields.emplace_back(field);
FieldDenotation &fieldDenotation = fields.back();
fieldDenotation.type = type;
fieldDenotation.tagType = currentTagType;
fieldDenotation.tagTarget = currentTagTarget;
if(equationPos) {
if(readOnly) {
cerr << "Warning: Specified value for \"" << fieldName << "\" will be ignored." << endl;
} else { } else {
fieldDenotation.values.emplace_back(make_pair(mult == 1 ? fieldDenotation.values.size() : fileIndex, QString::fromLocal8Bit(equationPos + 1))); // no "KnownField" value matching -> discard the field denotation
cerr << "Warning: The field name \"" << string(fieldDenotationString, fieldNameLen) << "\" is unknown and will be ingored." << endl;
continue;
}
// add field denotation with parsed values
fields.emplace_back(field);
FieldDenotation &fieldDenotation = fields.back();
fieldDenotation.type = type;
fieldDenotation.tagType = currentTagType;
fieldDenotation.tagTarget = currentTagTarget;
if(equationPos) {
if(readOnly) {
cerr << "Warning: Specified value for \"" << string(fieldDenotationString, fieldNameLen) << "\" will be ignored." << endl;
} else {
fieldDenotation.values.emplace_back(make_pair(mult == 1 ? fieldDenotation.values.size() : fileIndex, QString::fromLocal8Bit(equationPos + 1)));
}
} }
} }
} }
@ -645,7 +645,7 @@ void printProperty(const char *propName, const intType value, const char *suffix
void displayFileInfo(const std::vector<const char *> &, const Argument &filesArg, const Argument &verboseArg) void displayFileInfo(const std::vector<const char *> &, const Argument &filesArg, const Argument &verboseArg)
{ {
CMD_UTILS_START_CONSOLE; CMD_UTILS_START_CONSOLE;
if(filesArg.values().empty()) { if(!filesArg.isPresent() || filesArg.values().empty()) {
cout << "Error: No files have been specified." << endl; cout << "Error: No files have been specified." << endl;
return; return;
} }
@ -770,14 +770,14 @@ void displayFileInfo(const std::vector<const char *> &, const Argument &filesArg
} }
} }
void displayTagInfo(const std::vector<const char *> &parameterValues, const Argument &filesArg, const Argument &verboseArg) void displayTagInfo(const Argument &fieldsArg, const Argument &filesArg, const Argument &verboseArg)
{ {
CMD_UTILS_START_CONSOLE; CMD_UTILS_START_CONSOLE;
if(filesArg.values().empty()) { if(!filesArg.isPresent() || filesArg.values().empty()) {
cout << "Error: No files have been specified." << endl; cout << "Error: No files have been specified." << endl;
return; return;
} }
const auto fields = parseFieldDenotations(parameterValues, true); const auto fields = parseFieldDenotations(fieldsArg, true);
MediaFileInfo fileInfo; MediaFileInfo fileInfo;
for(const auto &file : filesArg.values()) { for(const auto &file : filesArg.values()) {
try { try {
@ -869,14 +869,14 @@ void displayTagInfo(const std::vector<const char *> &parameterValues, const Argu
} }
} }
void setTagInfo(const std::vector<const char *> &parameterValues, const SetTagInfoArgs &args) void setTagInfo(const SetTagInfoArgs &args)
{ {
CMD_UTILS_START_CONSOLE; CMD_UTILS_START_CONSOLE;
if(args.setTagInfoArg.values().empty()) { if(!args.filesArg.isPresent() || args.filesArg.values().empty()) {
cerr << "Error: No files have been specified." << endl; cerr << "Error: No files have been specified." << endl;
return; return;
} }
auto fields = parseFieldDenotations(parameterValues, false); auto fields = parseFieldDenotations(args.valuesArg, false);
if(fields.empty() && args.attachmentsArg.values().empty() && args.docTitleArg.values().empty()) { if(fields.empty() && args.attachmentsArg.values().empty() && args.docTitleArg.values().empty()) {
cerr << "Error: No fields/attachments have been specified." << endl; cerr << "Error: No fields/attachments have been specified." << endl;
return; return;
@ -892,15 +892,17 @@ void setTagInfo(const std::vector<const char *> &parameterValues, const SetTagIn
vector<TagTarget> targetsToRemove; vector<TagTarget> targetsToRemove;
targetsToRemove.emplace_back(); targetsToRemove.emplace_back();
bool validRemoveTargetsSpecified = false; bool validRemoveTargetsSpecified = false;
for(const auto &targetDenotation : args.removeTargetsArg.values()) { if(args.removeTargetsArg.isPresent()) {
if(!strcmp(targetDenotation, ",")) { for(const auto &targetDenotation : args.removeTargetsArg.values()) {
if(validRemoveTargetsSpecified) { if(!strcmp(targetDenotation, ",")) {
targetsToRemove.emplace_back(); if(validRemoveTargetsSpecified) {
targetsToRemove.emplace_back();
}
} else if(applyTargetConfiguration(targetsToRemove.back(), targetDenotation)) {
validRemoveTargetsSpecified = true;
} else {
cerr << "Warning: The given target specification \"" << targetDenotation << "\" is invalid and will be ignored." << endl;
} }
} else if(applyTargetConfiguration(targetsToRemove.back(), targetDenotation)) {
validRemoveTargetsSpecified = true;
} else {
cerr << "Warning: The given target specification \"" << targetDenotation << "\" is invalid and will be ignored." << endl;
} }
} }
// parse other settings // parse other settings
@ -955,7 +957,7 @@ void setTagInfo(const std::vector<const char *> &parameterValues, const SetTagIn
fileInfo.createAppropriateTags(args.treatUnknownFilesAsMp3FilesArg.isPresent(), id3v1Usage, id3v2Usage, args.mergeMultipleSuccessiveTagsArg.isPresent(), !args.id3v2VersionArg.isPresent(), id3v2Version, requiredTargets); fileInfo.createAppropriateTags(args.treatUnknownFilesAsMp3FilesArg.isPresent(), id3v1Usage, id3v2Usage, args.mergeMultipleSuccessiveTagsArg.isPresent(), !args.id3v2VersionArg.isPresent(), id3v2Version, requiredTargets);
auto container = fileInfo.container(); auto container = fileInfo.container();
bool docTitleModified = false; bool docTitleModified = false;
if(!args.docTitleArg.values().empty()) { if(args.docTitleArg.isPresent() && !args.docTitleArg.values().empty()) {
if(container && container->supportsTitle()) { if(container && container->supportsTitle()) {
size_t segmentIndex = 0, segmentCount = container->titles().size(); size_t segmentIndex = 0, segmentCount = container->titles().size();
for(const auto &newTitle : args.docTitleArg.values()) { for(const auto &newTitle : args.docTitleArg.values()) {
@ -1100,20 +1102,21 @@ void setTagInfo(const std::vector<const char *> &parameterValues, const SetTagIn
} else { } else {
cerr << "Warning: No changed to be applied." << endl; cerr << "Warning: No changed to be applied." << endl;
} }
} catch(const ios_base::failure &) {
cerr << "Error: An IO failure occured when reading/writing the file \"" << file << "\"." << endl;
} catch(const ApplicationUtilities::Failure &) { } catch(const ApplicationUtilities::Failure &) {
cerr << "Error: A parsing failure occured when reading/writing the file \"" << file << "\"." << endl; cerr << "Error: A parsing failure occured when reading/writing the file \"" << file << "\"." << endl;
} catch(...) {
::IoUtilities::catchIoFailure();
cerr << "Error: An IO failure occured when reading/writing the file \"" << file << "\"." << endl;
} }
printNotifications(notifications, "Notifications:", args.verboseArg.isPresent()); printNotifications(notifications, "Notifications:", args.verboseArg.isPresent());
++fileIndex; ++fileIndex;
} }
} }
void extractField(const std::vector<const char *> &parameterValues, const Argument &inputFileArg, const Argument &outputFileArg, const Argument &verboseArg) void extractField(const Argument &fieldsArg, const Argument &inputFileArg, const Argument &outputFileArg, const Argument &verboseArg)
{ {
CMD_UTILS_START_CONSOLE; CMD_UTILS_START_CONSOLE;
const auto fields = parseFieldDenotations(parameterValues, true); const auto fields = parseFieldDenotations(fieldsArg, true);
if(fields.size() != 1) { if(fields.size() != 1) {
cerr << "Error: Excactly one field needs to be specified." << endl; cerr << "Error: Excactly one field needs to be specified." << endl;
return; return;
@ -1124,7 +1127,7 @@ void extractField(const std::vector<const char *> &parameterValues, const Argume
inputFileInfo.setPath(inputFileArg.values().front()); inputFileInfo.setPath(inputFileArg.values().front());
inputFileInfo.open(true); inputFileInfo.open(true);
inputFileInfo.parseTags(); inputFileInfo.parseTags();
cout << "Extracting " << parameterValues.front() << " of \"" << inputFileArg.values().front() << "\" ..." << endl; cout << "Extracting " << fieldsArg.values().front() << " of \"" << inputFileArg.values().front() << "\" ..." << endl;
auto tags = inputFileInfo.tags(); auto tags = inputFileInfo.tags();
vector<pair<const TagValue *, string> > values; vector<pair<const TagValue *, string> > values;
// iterate through all tags // iterate through all tags
@ -1137,7 +1140,7 @@ void extractField(const std::vector<const char *> &parameterValues, const Argume
} }
} }
if(values.empty()) { if(values.empty()) {
cerr << "File has no (supported) " << parameterValues.front() << " field." << endl; cerr << "File has no (supported) " << fieldsArg.values().front() << " field." << endl;
} else { } else {
string outputFilePathWithoutExtension, outputFileExtension; string outputFilePathWithoutExtension, outputFileExtension;
if(values.size() > 1) { if(values.size() > 1) {

View File

@ -46,9 +46,9 @@ struct SetTagInfoArgs
void printFieldNames(const std::vector<const char *> &parameterValues); void printFieldNames(const std::vector<const char *> &parameterValues);
void displayFileInfo(const std::vector<const char *> &, const ApplicationUtilities::Argument &filesArg, const ApplicationUtilities::Argument &verboseArg); void displayFileInfo(const std::vector<const char *> &, const ApplicationUtilities::Argument &filesArg, const ApplicationUtilities::Argument &verboseArg);
void generateFileInfo(const std::vector<const char *> &parameterValues, const ApplicationUtilities::Argument &inputFileArg, const ApplicationUtilities::Argument &outputFileArg, const ApplicationUtilities::Argument &validateArg); void generateFileInfo(const std::vector<const char *> &parameterValues, const ApplicationUtilities::Argument &inputFileArg, const ApplicationUtilities::Argument &outputFileArg, const ApplicationUtilities::Argument &validateArg);
void displayTagInfo(const std::vector<const char *> &parameterValues, const ApplicationUtilities::Argument &filesArg, const ApplicationUtilities::Argument &verboseArg); void displayTagInfo(const ApplicationUtilities::Argument &fieldsArg, const ApplicationUtilities::Argument &filesArg, const ApplicationUtilities::Argument &verboseArg);
void setTagInfo(const std::vector<const char *> &parameterValues, const Cli::SetTagInfoArgs &args); void setTagInfo(const Cli::SetTagInfoArgs &args);
void extractField(const std::vector<const char *> &parameterValues, const ApplicationUtilities::Argument &inputFileArg, const ApplicationUtilities::Argument &outputFileArg, const ApplicationUtilities::Argument &verboseArg); void extractField(const ApplicationUtilities::Argument &fieldsArg, const ApplicationUtilities::Argument &inputFileArg, const ApplicationUtilities::Argument &outputFileArg, const ApplicationUtilities::Argument &verboseArg);
void removeBackupFiles(const std::vector<const char *> &parameterValues, const ApplicationUtilities::Argument &recursiveArg); void removeBackupFiles(const std::vector<const char *> &parameterValues, const ApplicationUtilities::Argument &recursiveArg);
} }