2015-12-16 00:07:31 -05:00
|
|
|
# frozen_string_literal: false
|
2001-04-30 13:38:21 -04:00
|
|
|
#
|
2008-06-04 05:37:38 -04:00
|
|
|
# irb/help.rb - print usage module
|
2009-07-07 07:36:20 -04:00
|
|
|
# $Release Version: 0.9.6$
|
2001-04-30 13:38:21 -04:00
|
|
|
# $Revision$
|
|
|
|
# by Keiju ISHITSUKA(keiju@ishitsuka.com)
|
|
|
|
#
|
|
|
|
# --
|
|
|
|
#
|
2009-03-05 22:56:38 -05:00
|
|
|
#
|
2001-04-30 13:38:21 -04:00
|
|
|
#
|
|
|
|
|
2008-12-18 08:09:26 -05:00
|
|
|
require 'irb/magic-file'
|
|
|
|
|
2001-04-30 13:38:21 -04:00
|
|
|
module IRB
|
2012-12-21 00:45:50 -05:00
|
|
|
# Outputs the irb help message, see IRB@Command+line+options.
|
2001-04-30 13:38:21 -04:00
|
|
|
def IRB.print_usage
|
|
|
|
lc = IRB.conf[:LC_MESSAGES]
|
|
|
|
path = lc.find("irb/help-message")
|
|
|
|
space_line = false
|
2008-12-18 08:09:26 -05:00
|
|
|
IRB::MagicFile.open(path){|f|
|
|
|
|
f.each_line do |l|
|
2014-08-08 21:36:49 -04:00
|
|
|
if /^\s*$/ =~ l
|
|
|
|
lc.puts l unless space_line
|
|
|
|
space_line = true
|
|
|
|
next
|
|
|
|
end
|
|
|
|
space_line = false
|
2008-12-18 08:09:26 -05:00
|
|
|
|
2014-08-08 21:36:49 -04:00
|
|
|
l.sub!(/#.*$/, "")
|
|
|
|
next if /^\s*$/ =~ l
|
|
|
|
lc.puts l
|
2001-04-30 13:38:21 -04:00
|
|
|
end
|
2008-12-18 08:09:26 -05:00
|
|
|
}
|
2001-04-30 13:38:21 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|