X-Git-Url: http://git.treefish.org/~alex/usetaglib.git/blobdiff_plain/9dbc165a7224f6d08ddf18f509a498694a9b47b9..c601670587f56d9123eb81d6d4294edc6ad1f4ae:/usetaglib.cpp diff --git a/usetaglib.cpp b/usetaglib.cpp index 3a8f435..6a3a7a8 100644 --- a/usetaglib.cpp +++ b/usetaglib.cpp @@ -69,18 +69,17 @@ void action_insertTag (TagLib::PropertyMap &propmap, const tagpair &tagPair) propmap.insert(tagPair.first, argToStringList(tagPair.second)); } -int action_printTags (const TagLib::FileRef f) +int action_printTags (const TagLib::FileRef f, TagLib::PropertyMap &propmap) { if(f.tag()) { - TagLib::PropertyMap tags = f.file()->properties(); unsigned int longest = 0; - for(TagLib::PropertyMap::ConstIterator i = tags.begin(); i != tags.end(); ++i) { + for(TagLib::PropertyMap::ConstIterator i = propmap.begin(); i != propmap.end(); ++i) { if (i->first.size() > longest) { longest = i->first.size(); } } cout << "-- TAG (properties) --" << endl; - for(TagLib::PropertyMap::ConstIterator i = tags.begin(); i != tags.end(); ++i) { + for(TagLib::PropertyMap::ConstIterator i = propmap.begin(); i != propmap.end(); ++i) { for(TagLib::StringList::ConstIterator j = i->second.begin(); j != i->second.end(); ++j) { cout << i->first << "=" << *j << endl; } @@ -109,9 +108,7 @@ int action_printAudio (const TagLib::FileRef f) } void printHelp () -{ - return; - +{ cout << "Usage: usetaglib [ACTION]... [FILE]..." << endl; cout << "List and edit tags on mediafiles in formats supported by libtag." << endl; cout << endl; @@ -137,6 +134,8 @@ void printHelp () cout << " usetaglib -e ALBUM file.flac" << endl; cout << " usetaglib -i ARTIST=Horst=Hubert file.mp3" << endl; cout << " usetaglib -r ARTIST=Horst file.ogg" << endl; + cout << " usetaglib -i \"ALBUMARTIST=Horst und Hubert\" file.ogg" << endl; + cout << " usetaglib --insert=\"ALBUMARTIST=Horst und Hubert\" file.ogg" << endl; } int main(int argc, char *argv[]) @@ -224,7 +223,7 @@ int main(int argc, char *argv[]) for (actionqueue::iterator actit = requestedActions.begin(); actit != requestedActions.end(); ++actit) { switch (actit->first) { case LIST: - action_printTags(f); + action_printTags(f, propmap); break; case AUDIO: