#!/usr/bin/env ruby require 'rbbt-util' require 'rbbt/util/simpleopt' $0 = "rbbt #{$previous_commands*""} #{ File.basename(__FILE__) }" if $previous_commands options = SOPT.setup < DEBUG LOW MEDIUM HIGH INFO WARN ERROR NONE -h--help Print this help EOF rbbt_usage and exit 0 if options[:help] if ARGV.empty? if Rbbt.etc.log_severity.exists? puts Rbbt.etc.log_severity.read else puts Rbbt.etc.log_severity.find + ' does not exist' end else level = ARGV[0] level = %w(DEBUG LOW MEDIUM HIGH INFO WARN ERROR NONE)[level.to_i] if level =~ /^\d+$/ Open.write(Rbbt.etc.log_severity, level.upcase) end