#!/usr/pkg/bin/ruby40
# frozen_string_literal: true

asciidoctor = File.absolute_path '../lib/asciidoctor.rb', __dir__
if File.exist? asciidoctor
  require asciidoctor
  require File.join Asciidoctor::LIB_DIR, 'asciidoctor/cli'
else
  require 'asciidoctor'
  require 'asciidoctor/cli'
end

invoker = Asciidoctor::Cli::Invoker.new ARGV
GC.start
invoker.invoke!
exit invoker.code
