Sha256: 9855a9fc9fa1d7c870a0933d32ca7908b3e1e6f14d139ac57c19544cf37de560

Contents?: true

Size: 892 Bytes

Versions: 1

Compression:

Stored size: 892 Bytes

Contents

#!/usr/bin/env ruby

require_relative '../lib/asciidoctor-epub3'
require 'asciidoctor/cli'

options = Asciidoctor::Cli::Options.new backend: 'epub3'

# FIXME provide an API in Asciidoctor for sub-components to print version information
unless ARGV != ['-v'] && (ARGV & ['-V', '--version']).empty?
  require_relative '../lib/asciidoctor-epub3/version'
  $stdout.write %(Asciidoctor EPUB3 #{Asciidoctor::Epub3::VERSION} using )
  # NOTE the print_version method was added in Asciidoctor 1.5.2
  if options.respond_to? :print_version
    options.print_version
  else
    puts %(Asciidoctor #{::Asciidoctor::VERSION} [http://asciidoctor.org])
  end
  exit 0
end

# FIXME This is a really bizarre API. Please make me simpler.
case (result = options.parse! ARGV)
when Integer
  exit result
else
  invoker = Asciidoctor::Cli::Invoker.new options
  GC.start
  invoker.invoke!
  exit invoker.code
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
asciidoctor-epub3-1.5.0.alpha.5 bin/asciidoctor-epub3