Module: HexaPDF::CLI

Defined in:
lib/hexapdf/cli.rb,
lib/hexapdf/cli/form.rb,
lib/hexapdf/cli/info.rb,
lib/hexapdf/cli/batch.rb,
lib/hexapdf/cli/files.rb,
lib/hexapdf/cli/fonts.rb,
lib/hexapdf/cli/merge.rb,
lib/hexapdf/cli/split.rb,
lib/hexapdf/cli/usage.rb,
lib/hexapdf/cli/images.rb,
lib/hexapdf/cli/modify.rb,
lib/hexapdf/cli/command.rb,
lib/hexapdf/cli/inspect.rb,
lib/hexapdf/cli/optimize.rb,
lib/hexapdf/cli/image2pdf.rb,
lib/hexapdf/cli/watermark.rb

Overview

Contains the code for the hexapdf binary. The binary uses the cmdparse library (cmdparse.gettalong.org) for the command suite support.

Defined Under Namespace

Classes: Application, Batch, Command, Error, Files, Fonts, Form, Image2PDF, Images, Info, Inspect, Merge, Modify, Optimize, Split, Usage, Watermark

Class Method Summary collapse

Class Method Details

.run(args = ARGV) ⇒ Object

Runs the CLI application.



62
63
64
65
66
67
68
69
70
71
# File 'lib/hexapdf/cli.rb', line 62

def self.run(args = ARGV)
  Application.new.parse(args)
rescue StandardError => e
  $stderr.puts "Problem encountered: #{e.message}"
  unless e.kind_of?(HexaPDF::Error)
    $stderr.puts "--> The problem might indicate a faulty PDF or a bug in HexaPDF."
    $stderr.puts "--> Please report this at https://github.com/gettalong/hexapdf/issues - thanks!"
  end
  exit(1)
end