bin/fbchk in sportdb-formats-2.1.0 vs bin/fbchk in sportdb-formats-2.1.1
- old
+ new
@@ -21,10 +21,11 @@
args = ARGV
opts = { debug: false,
file: nil,
+ teams: true, ## check/lint teams (name errros etc.)
}
parser = OptionParser.new do |parser|
parser.banner = "Usage: #{$PROGRAM_NAME} [options]"
@@ -43,14 +44,18 @@
parser.on( "-f FILE", "--file FILE",
"read datafiles (pathspecs) via .csv file") do |file|
opts[:file] = file
end
-
+ parser.on( "--[no]-teams",
+ "turn on/off team name checks (default: #{opts[:teams]})") do |teams|
+ opts[:teams] = teams
+ end
end
parser.parse!( args )
+
puts "OPTS:"
p opts
puts "ARGV:"
p args
@@ -93,11 +98,13 @@
specs.each_with_index do |(paths, rec),i|
errors = []
paths.each_with_index do |path,j|
puts "==> [#{j+1}/#{paths.size}] reading >#{path}<..."
- quick = SportDb::QuickMatchLinter.new( read_text( path ) )
+ quick = SportDb::QuickMatchLinter.new( read_text( path ),
+ check_teams: opts[:teams] )
matches = quick.parse
+
if quick.errors?
puts "!! #{quick.errors.size} error(s):"
pp quick.errors