Class: Csvlint::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/csvlint/cli.rb

Instance Method Summary collapse

Instance Method Details

#helpObject



25
26
27
# File 'lib/csvlint/cli.rb', line 25

def help
  self.class.command_help(shell, :validate)
end

#validate(source = nil) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/csvlint/cli.rb', line 16

def validate(source = nil)
  source = read_source(source)
  @schema = get_schema(options[:schema]) if options[:schema]
  fetch_schema_tables(@schema, options) if source.nil?

  valid = validate_csv(source, @schema, options[:dump], options[:json])
  exit 1 unless valid
end