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