diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2010-10-16 18:30:39 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2010-10-16 18:30:39 -0700 |
commit | da937363aa86641df8affb839576c41c711b1192 (patch) | |
tree | 4f658f6bec7b36f7e96bd2821cbf25af6a4b7025 /omptagger | |
parent | 8da7b85282897e6069d75beb85d21bd71bd0c4d2 (diff) | |
download | omptagger-da937363aa86641df8affb839576c41c711b1192.tar.gz omptagger-da937363aa86641df8affb839576c41c711b1192.tar.xz |
Always output uppercase field names.
Diffstat (limited to 'omptagger')
-rwxr-xr-x | omptagger | 26 |
1 files changed, 15 insertions, 11 deletions
@@ -131,7 +131,7 @@ class Metadata end def view - Output.action('Viewing all tags') + Output.action('Viewing all fields') next_if_no_fields_set @@ -143,7 +143,9 @@ class Metadata end def viewtag(field) - Output.action('Viewing ' + field + ' tag') + field.upcase! + + Output.action('Viewing ' + field + ' field') next_if_field_not_set(field) @@ -153,11 +155,11 @@ class Metadata end def addtag(field, value) - Output.action('Adding ' + field + ' tag') + field.upcase! - next_if_not_valid_field(field) + Output.action('Adding ' + field + ' field') - field.upcase! + next_if_not_valid_field(field) if @metadata.has_key?(field) @metadata[field] << value @@ -171,11 +173,11 @@ class Metadata end def settag(field, value) - Output.action('Setting ' + field + ' tag') + field.upcase! - next_if_not_valid_field(field) + Output.action('Setting ' + field + ' field') - field.upcase! + next_if_not_valid_field(field) @metadata[field] = [value] Output.field(field, value) @@ -184,7 +186,7 @@ class Metadata end def remove - Output.action('Removing all tags') + Output.action('Removing all fields') next_if_no_fields_set @@ -195,7 +197,9 @@ class Metadata end def removetag(field) - Output.action('Removing ' + field + ' tag') + field.upcase! + + Output.action('Removing ' + field + ' field') next_if_field_not_set(field) @@ -344,7 +348,7 @@ GetoptLong.new( when :nocolour, :pretend options << option when :viewtag, :removetag - actions << [option, argument] + actions << [option, argument.dup] when :addtag, :settag raise 'Incorrect argument' unless argument.include?('=') actions << [option, argument.split('=', 2)].flatten |