Module: HtmlToMarkdown::CLI

Defined in:
lib/html_to_markdown/cli.rb

Class Method Summary collapse

Class Method Details

.run(argv = ARGV, stdout: $stdout, stderr: $stderr) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/html_to_markdown/cli.rb', line 9

def run(argv = ARGV, stdout: $stdout, stderr: $stderr)
  output = CLIProxy.call(argv)
  stdout.print(output)
  0
rescue CLIProxy::CLIExecutionError => e
  stderr.print(e.stderr)
  e.status || 1
rescue CLIProxy::MissingBinaryError, CLIProxy::Error => e
  stderr.puts(e.message)
  1
end