4.1 MCMD Module Configuration

MCMD module is built using KGMOD library. All shell variables set in KGMOD can be used. The following explains the configuration method of Ruby MCMD module.

4.1.1 Output message

The environment variable KG_VerboseLevel can be set to control the message to standard error for various methods such as Mcsvin. The parameter and details are as follows.

Table 4.1: Parameters of environment variables that control the message and its contents

Parameter

Description

0

Do not output any message

1

+ error message output

2

+ warning message output

3

+ end message output

4

+ msg message output (default)

$ irb
> require 'mcmd'

# By default KG_Verbose=4, both normal message and error message are displayed. 
> MCMD::Mcsvin.new("i=dat.csv"){|csv| csv.each{|flds|}}
#END# mcsvin i=dat.csv; ; 2013/08/08 15:18:52
> MCMD::Mcsvin.new("x=dat.csv"){|csv| csv.each{|flds|}}
#ERROR# unknown parameter x= (mcsvin); mcsvin x=dat.csv; ; 2013/08/08 15:18:52

# When KG_Verbose=1, ending error message is displayed, but the normal ending message is not displayed. 
> ENV["KG_VerboseLevel"] = "1"
> MCMD::Mcsvin.new("i=dat.csv"){|csv| csv.each{|flds|}}
> MCMD::Mcsvin.new("x=dat.csv"){|csv| csv.each{|flds|}}
#ERROR# unknown parameter x= (mcsvin); mcsvin x=dat.csv; ; 2013/08/08 15:18:52

# When KG_Verbose=0, both messages are not displayed.
> ENV["KG_VerboseLevel"] = "0"
> MCMD::Mcsvin.new("i=dat.csv"){|csv| csv.each{|flds|}}
> MCMD::Mcsvin.new("x=dat.csv"){|csv| csv.each{|flds|}}