#!/usr/pkg/bin/ruby33
#
# Copyright (c) 2008-2020 Minero Aoki, Kenshi Muto
#               1999-2007 Minero Aoki
#
# This program is free software.
# You can distribute or modify this program under the terms of
# the GNU LGPL, Lesser General Public License version 2.1.
# For details of the GNU LGPL, see the file "COPYING".
#

$LOAD_PATH.unshift(File.realpath('../lib', __dir__))

require 'review/tocprinter'

begin
  Signal.trap(:INT) { exit 1 }
  unless RUBY_PLATFORM.match?(/mswin(?!ce)|mingw|cygwin|bccwin/)
    Signal.trap(:PIPE, 'IGNORE')
  end

  ReVIEW::TOCPrinter.execute(*ARGV)
rescue Errno::EPIPE
  exit 0
end
