Class: MarkdownLint::CLI

Inherits:
Object
  • Object
show all
Includes:
Mixlib::CLI
Defined in:
lib/mdl/cli.rb

Instance Method Summary collapse

Instance Method Details

#run(argv = ARGV) ⇒ Object



74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/mdl/cli.rb', line 74

def run(argv=ARGV)
  parse_options(argv)
  # Load the config file if it's present
  filename = File.expand_path(config[:config_file])
  MarkdownLint::Config.from_file(filename) if File.exists?(filename)

  # Put values in the config file
  MarkdownLint::Config.merge!(config)

  # Read from stdin if we didn't provide a filename
  if cli_arguments.empty? and not config[:list_rules]
    cli_arguments << "-"
  end
end