Index: bin/bitclust.rb =================================================================== --- bin/bitclust.rb (revision 533) +++ bin/bitclust.rb (working copy) @@ -24,7 +24,12 @@ require 'optparse' def main - Signal.trap(:PIPE) { exit 1 } + begin + Signal.trap(:PIPE, 'EXIT') + rescue ArgumentError + # mswin32, mingw32 + # unsupported signal SIGPIPE + end Signal.trap(:INT) { exit 1 } prefix = nil Index: bin/bc-rdoc.rb =================================================================== --- bin/bc-rdoc.rb (revision 533) +++ bin/bc-rdoc.rb (working copy) @@ -17,12 +17,18 @@ class ApplicationError < StandardError; end def main - Signal.trap(:PIPE, 'EXIT') + begin + Signal.trap(:PIPE, 'EXIT') + rescue ArgumentError + # mswin32, mingw32 + # unsupported signal SIGPIPE + end Signal.trap(:INT, 'EXIT') prefix = nil mode = :list type = :name + rdoc_dir = nil parser = OptionParser.new parser.banner = "Usage: #{File.basename($0)} " parser.on('-d', '--database=PREFIX', 'BitClust database path') {|path| @@ -34,6 +40,9 @@ parser.on('-c', '--content', 'Prints method description') { type = :content } + parser.on('--rdoc-database=DIR', 'RDoc/ri database directory') {|path| + rdoc_dir = path + } parser.on('--help', 'Prints this message and quit.') { puts parser.help exit 0 @@ -46,8 +55,12 @@ exit 1 end - # use only system database - path = RI::Paths.path(true, false, false, false) + unless rdoc_dir + # use only system database + path = RI::Paths.path(true, false, false, false) + else + path = RI::Paths.path(false, false, false, false, rdoc_dir) + end reader = RI::RiReader.new(RI::RiCache.new(path)) case mode when :list