bin/rumai in rumai-3.2.1 vs bin/rumai in rumai-3.2.2
- old
+ new
@@ -1,13 +1,50 @@
#!/usr/bin/env ruby
#
-# This program is an interactive shell for Rumai.
+# This is an interactive Ruby shell (IRB) for Rumai.
#
-# Command-line options and arguments given to this program are passed
-# directly to the underlying IRB (the interactive Ruby shell) session.
#
+# Usage:
+#
+# rumai [Options] [STUFF_FOR_IRB]
+#
+# STUFF_FOR_IRB : Arguments and options for `irb`.
+#
+#
+# Options:
+#
+# -h, --help : Show this message and exit.
+#
+# -v, --version : Show version number and exit.
+#
+$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
+require 'rumai'
+
+# parse command line
+if ARGV.delete('-h') or ARGV.delete('--help')
+ puts
+ puts Rumai.inspect
+ puts Rumai::TAGLINE
+ puts
+ puts
+ puts File.read(__FILE__)[/^#(\r?\n)(.*?)\1\1/m, 2].gsub(/^# ?/, '')
+ puts
+ puts
+ puts 'Read the user manual for more information:'
+ puts
+ puts " #{Rumai::INSTDIR}/doc/index.html"
+ puts
+ puts " #{Rumai::WEBSITE}"
+ puts
+ exit
+elsif ARGV.delete('-v') or ARGV.delete('--version')
+ puts Rumai::VERSION
+ exit
+end
+
+# start IRB session
require 'irb'
require 'irb/completion' # enable TAB-completion
module IRB
##
@@ -26,11 +63,7 @@
catch :IRB_EXIT do
irb.eval_input
end
end
end
-
-# start IRB session
-$LOAD_PATH << File.expand_path('../../lib', __FILE__)
-require 'rumai'
IRB.start_session Rumai