From 3f002dd634293f516fbfcf912715727eda05c80c Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Wed, 20 Oct 2010 01:26:31 -0700 Subject: Minor code improvements. --- omptagger | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/omptagger b/omptagger index e5e4ad3..8ca383d 100755 --- a/omptagger +++ b/omptagger @@ -21,10 +21,14 @@ require 'TagLib' require 'filemagic' module Output - @colour = true + @@colour = true + + def self.colour=(boolean) + @@colour = boolean + end def self.colourise(string, colour) - return string unless @colour + return string unless @@colour case colour when :green @@ -454,10 +458,8 @@ GetoptLong.new( Output.help_information when :info Output.additional_information - when :scheme + when :nocolour, :pretend, :scheme options[option] = argument - when :nocolour, :pretend - options[option] = true when :viewtag, :removetag actions << Action.new(option, argument.dup) when :addtag, :settag @@ -479,9 +481,7 @@ elsif ARGV.empty? end if options[:nocolour] - module Output - @colour = false - end + Output.colour = false end ARGV.each do |filename| -- cgit v1.2.3-70-g09d2