desc 'Enable debugging library (leap_cli development only)'
switch :debug, :negatable => false
+ desc 'Disable colors in output'
+ default_value true
+ switch 'color', :negatable => true
+
pre do |global,command,options,args|
#
# set verbosity
LeapCli.log_file = global[:log] || LeapCli.leapfile.log
LeapCli::Util.log_raw(:log) { $0 + ' ' + ORIGINAL_ARGV.join(' ')}
log_version
+ LeapCli.log_in_color = global[:color]
#
# load all the nodes everything
module LeapCli
extend self
+ attr_accessor :log_in_color
+
# logging options
def log_level
@log_level ||= 1
message = LeapCli::Path.relative_path(message)
end
- log_raw(:log, nil) { [clear_prefix, message].join }
- log_raw(:stdout, options[:indent]) { [colored_prefix, message].join }
+ log_raw(:log, nil) { [clear_prefix, message].join }
+ if LeapCli.log_in_color
+ log_raw(:stdout, options[:indent]) { [colored_prefix, message].join }
+ else
+ log_raw(:stdout, options[:indent]) { [clear_prefix, message].join }
+ end
# run block, if given
if block_given?