diff options
author | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-25 14:19:22 +0000 |
---|---|---|
committer | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-25 14:19:22 +0000 |
commit | 4cdf253e4d129d35f49c8fb77fde90b72c5ae577 (patch) | |
tree | 25ea11df828ac6985573650df0822f5dd1022638 | |
parent | aa9d57c8736cc154dde612cad4ced7d4d9fde478 (diff) | |
download | ruby-4cdf253e4d129d35f49c8fb77fde90b72c5ae577.tar.gz |
Add --version option to ri
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/rdoc/ri/ri_options.rb | 18 |
2 files changed, 21 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Thu Mar 25 23:15:24 2004 Dave Thomas <dave@pragprog.com> + + * lib/rdoc/ri/ri_options.rb (RI::Options::show_version): + Add --version option + Thu Mar 25 21:45:00 2004 Shigeo Kobayashi <shigek@ruby-lang.org> * ext/bigdecimal/bigdecimal.c: Bug in + and - reported by Bret Jolly @@ -10,7 +15,6 @@ Thu Mar 25 21:01:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> * win32/resource.rb: ditto. ->>>>>>> 1.3093 Thu Mar 25 19:37:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> * win32/resource.rb: default rubyw icon to ruby.ico, and let DLL also diff --git a/lib/rdoc/ri/ri_options.rb b/lib/rdoc/ri/ri_options.rb index d9ece2067c..aeda25106e 100644 --- a/lib/rdoc/ri/ri_options.rb +++ b/lib/rdoc/ri/ri_options.rb @@ -5,7 +5,8 @@ module RI require 'rdoc/ri/ri_display' - VERSION_STRING = "alpha 0.1" + VERSION_STRING = "beta1" + CVS_ID = "$Id"; class Options @@ -64,7 +65,11 @@ module RI ], [ "--width", "-w", "output width", - "set the width of the output" ], + "Set the width of the output" ], + + [ "--version", "-v", nil, + "Display the version of ri" + ], ] @@ -163,6 +168,14 @@ module RI end end + # Show the version and exit + def show_version + cvs_info = CVS_ID.split + puts "ri #{VERSION_STRING} (#{cvs_info[2]} #{cvs_info[3]})" + exit(0) + end + + # Parse command line options. def parse @@ -186,6 +199,7 @@ module RI go.each do |opt, arg| case opt when "--help" then OptionList.usage + when "--version" then show_version when "--list-names" then @list_names = true when "--no-pager" then @use_stdout = true when "--classes" then @list_classes = true |