diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2009-07-11 21:20:40 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2010-10-05 22:07:07 -0700 |
commit | 584076f023c5dfe9d1fbb0a31cd179036107f66c (patch) | |
tree | 4642557e73cc28004f0a811e81e348dce93e9666 /omptagger | |
parent | 05c5339e3becec9224549e5aae5e2f77716fc86d (diff) | |
download | omptagger-584076f023c5dfe9d1fbb0a31cd179036107f66c.tar.gz omptagger-584076f023c5dfe9d1fbb0a31cd179036107f66c.tar.xz |
Import version 1.0.3 into git history.
Diffstat (limited to 'omptagger')
-rwxr-xr-x | omptagger | 43 |
1 files changed, 24 insertions, 19 deletions
@@ -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 <omp@gentoo.org> +# Copyright 2007-2009 David Shakaryan <omp@gentoo.org> # 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 |