diff --git a/cdripper b/cdripper index 6e45817..9c162a3 100755 --- a/cdripper +++ b/cdripper @@ -1,7 +1,7 @@ #!/usr/bin/perl # # CD Ripper -# usage: cdripper [-o num] [--no-cddb] [-T] [-a] [-y] [target_directory] +# usage: cdripper [-o num] [--no-cddb] [-T] [-0] [-a] [-y] [target_directory] # # Rips the contents of an audio CD into Ogg Vorbis files # Puts the files in target_directory/artist/album_name/ @@ -12,6 +12,7 @@ # Changelog: # 0.2.4: Fixed bug - files should get tagged again # Added support for -T option +# Added support for -0 option # 0.2: Aligned version with ds-audiotools # Implemented CDDB support (disabled with --no-cddb) # Ability to preview and edit all text before it's used @@ -36,12 +37,13 @@ use CDDB_get qw( get_cddb ); $VERSION = "0.2.4"; $HELP_MSG = "# CD Ripper v$VERSION\n\tusage: cdripper [--no-cddb] [-a] " . - "[-y] [-o num] [target_directory]\n\n" . + "[-y] [-T] [-0] [-o num] [target_directory]\n\n" . "Options:\n-a:\t\tAsk users about multiple CDDB options\n" . "-o [num]:\tOffset track numbers by num. The first track will be num+1\n" . "-y:\t\tDon't prompt for user confirmation of CDDB information\n\t\t(assume defaults are okay).\n" . "--no-cddb:\tDon't use CDDB. Prompt the user for all information.\n" . - "-T:\t\tWrite uppercase tag names. Passes -T to tagfromfilename\n"; + "-T:\t\tWrite uppercase tag names. Passes -T to tagfromfilename\n" . + "-0:\t\tPreserve leading 0 in track numbers\n"; $CDPARANOIA_FORMAT = 'track*.cdda'; $TRACK_ZERO = 'track00'; @@ -53,6 +55,8 @@ $useCDDB = 1; $noInput = 0; $askCDDB = 0; +$tagoptions = ''; + foreach (@ARGV) { if ($offsetOnNext) @@ -67,7 +71,8 @@ foreach (@ARGV) elsif (/^--no-cddb$/) { $useCDDB = 0; } elsif (/^-f$/) { $noInput = 1; } elsif (/^-a$/) { $askCDDB = 1; } - elsif (/^-T$/) { $uppertags = '-T'; } + elsif (/^-T$/) { $tagoptions .= ' -T'; } + elsif (/^-0$/) { $tagoptions .= ' -0'; } else { $target_directory = $_; @@ -104,7 +109,7 @@ chdir($final_location); warn "Some files were not automatically named." if $unhandledFiles; # Add vorbiscomment data -system('tagfromfilename', $uppertags, @new_tracks); +system('tagfromfilename', $tagoptions, @new_tracks); # Clean up chdir($orig_dir);