summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 5af6eb1..7c8b34c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -19,6 +19,10 @@ fn parse_options_into(opt: &mut Options) {
.add_option(&["-w", "--write"], StoreTrue,
"Write updated information instead of just displaying. Unmodified or unknown tags are preserved as-is.");
+ ap.refer(&mut opt.clean)
+ .add_option(&["--clean"], StoreTrue,
+ "Remove any existing fields in ID3v2.* tag, and convert to ID3v2.3 (pending commit with --write)");
+
ap.refer(&mut opt.latin1_as_utf8)
.add_option(&["--assume-utf8"], StoreTrue,
"Assume that all strings specified in the MP3 as Latin-1 are really UTF-8.");
@@ -122,6 +126,12 @@ fn main() -> io::Result<()> {
tag
};
+ if options.clean {
+ tag.frames.clear();
+ tag.version_sub = 3;
+ eprintln!("NOTE: Removed all existing fields and set version sub to 3 (to make an ID3v2.3 tag)");
+ }
+
if options.latin1_as_utf8 {
for frame in &mut tag.frames {
if let Some(new_frame) =