From 584076f023c5dfe9d1fbb0a31cd179036107f66c Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sat, 11 Jul 2009 21:20:40 -0700 Subject: Import version 1.0.3 into git history. --- omptagger | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) (limited to 'omptagger') diff --git a/omptagger b/omptagger index d5df810..aa8502d 100755 --- a/omptagger +++ b/omptagger @@ -1,9 +1,9 @@ #!/usr/bin/env ruby # -# omptagger [version 1.0.2] +# omptagger [version 1.0.3] # http://dev.gentoo.org/~omp/omptagger/ # -# Copyright 2007-2008 David Shakaryan +# Copyright 2007-2009 David Shakaryan # Distributed under the terms of the GNU General Public License v3. # See http://www.gnu.org/licenses/gpl.txt for the full license text. # @@ -63,21 +63,24 @@ end # Display help information. def help - options = [['--view -v', 'View all tags'], - ['--view-tag -t', 'View a tag'], - ['--set-tag -s', 'Set a tag'], - ['--remove -r', 'Remove all tags'], - ['--remove-tag -d', 'Remove a tag'], - ['--generate -g', 'Generate tags based on filename'], - ['--rename -m', 'Generate filename based on tags'], - ['--scheme -n', 'Specify a file naming scheme'], - ['--pretend -p', 'Do not make any actual changes'], - ['--no-colour -c', 'Disable use of colour in output'], - ['--list -l', 'Display list of available tags'], - ['--help -h', 'Display help information']] - notes = ['The default file naming scheme is Artist - Title.', - 'Schemes must be specified prior to actions that use them.', - 'Underscores in filenames are converted to spaces in tags.'] + options = [ + ['--view -v', 'View all tags'], + ['--view-tag -t', 'View a tag'], + ['--set-tag -s', 'Set a tag'], + ['--remove -r', 'Remove all tags'], + ['--remove-tag -d', 'Remove a tag'], + ['--generate -g', 'Generate tags based on filename'], + ['--rename -m', 'Generate filename based on tags'], + ['--scheme -n', 'Specify a file naming scheme'], + ['--pretend -p', 'Do not make any actual changes'], + ['--no-colour -c', 'Disable use of colour in output'], + ['--list -l', 'Display list of available tags'], + ['--help -h', 'Display help information']] + notes = [ + 'The default file naming scheme is Artist - Title.', + 'Schemes must be specified prior to actions that use them.', + 'Underscores in filenames are converted to spaces in tags.', + 'Backslashes in filenames are converted to forward slashes in tags.'] puts colyel('Usage:') + ' omptagger ' + colgrn('[options] [files]') puts @@ -208,8 +211,10 @@ class VorbisComments end def generate(scheme) - val = File.basename(@file, File.extname(@file)).gsub('_', ' ') - scheme = schemesplit(scheme.gsub('_', ' '), val, KEYS.keys.join) + val = File.basename(@file, File.extname(@file)) + val = val.gsub('_', ' ').gsub('\\', '/') + scheme = scheme.gsub('_', ' ').gsub('\\', '/') + scheme = schemesplit(scheme, val, KEYS.keys.join) tagval = Array.new -- cgit v1.2.3-70-g09d2