add option metaflac --show-all-tags

Co-authored-by: Martijn van Beurden <mvanb1@gmail.com>
This commit is contained in:
harridu 2022-11-08 17:09:22 +01:00 committed by GitHub
parent 20d8b0f50c
commit 0ab961de52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 1 deletions

View File

@ -109,6 +109,9 @@ modification time is set to the current time):
**\--show-tag=name**
: Show all tags where the field name matches 'name'.
**\--show-all-tags**
: Show all tags. This is an alias for --export-tags-to=-.
**\--remove-tag=name**
: Remove all tags whose field name is 'name'.

View File

@ -65,6 +65,7 @@ struct share__option long_options_[] = {
{ "set-bps", 1, 0, 0 }, /* undocumented */
{ "set-total-samples", 1, 0, 0 }, /* undocumented */ /* WATCHOUT: used by test/test_flac.sh on windows */
{ "show-vendor-tag", 0, 0, 0 },
{ "show-all-tags", 0, 0, 0 },
{ "show-tag", 1, 0, 0 },
{ "remove-all-tags", 0, 0, 0 },
{ "remove-all-tags-except", 1, 0, 0 },
@ -496,6 +497,10 @@ FLAC__bool parse_option(int option_index, const char *option_argument, CommandLi
ok = false;
}
}
else if(0 == strcmp(opt, "show-all-tags")) {
op = append_shorthand_operation(options, OP__EXPORT_VC_TO);
parse_string("-",&op->argument.filename.value);
}
else if(0 == strcmp(opt, "remove-all-tags")) {
(void) append_shorthand_operation(options, OP__REMOVE_VC_ALL);
}

View File

@ -124,6 +124,7 @@ int long_usage(const char *message, ...)
fprintf(out, "\n");
fprintf(out, "--show-vendor-tag Show the vendor string from the VORBIS_COMMENT block.\n");
fprintf(out, "--show-tag=NAME Show all tags where the field name matches 'NAME'.\n");
fprintf(out, "--show-all-tags Show all tags. This is an alias for --export-tags-to=-.\n");
fprintf(out, "--remove-tag=NAME Remove all tags whose field name is 'NAME'.\n");
fprintf(out, "--remove-first-tag=NAME Remove first tag whose field name is 'NAME'.\n");
fprintf(out, "--remove-all-tags Remove all tags, leaving only the vendor string.\n");

View File

@ -80,7 +80,8 @@ EXTRA_DIST = \
case60-expect.meta \
case61-expect.meta \
case62-expect.meta \
case63-expect.meta
case63-expect.meta \
case64-expect.meta
clean-local:
-rm -f out.*

View File

@ -0,0 +1,3 @@
TITLE=Tittle
artist=Fartist
artist=artits

View File

@ -372,6 +372,8 @@ metaflac_test case62 "--import-picture-from" "--list"
run_metaflac --remove-all-tags-except=artist=title $flacfile
check_flac
metaflac_test case63 "--remove-all-tags-except=artist=title" "--list"
metaflac_test case64 "--export-tags-to=-" "--export-tags-to=-"
metaflac_test case64 "--show-all-tags" "--show-all-tags"
# UNKNOWN blocks
echo $ECHO_N "Testing FLAC file with unknown metadata... " $ECHO_C