summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2024-01-30 22:36:47 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2024-01-30 22:36:47 +0900
commit64fa4c758734433d225f336ca63b4d2619fed8e5 (patch)
tree44f33f734bb666642d4097a5d27f4e16b3ec52fd
parentfd44b42fb308ddf71d709a508901d68583e61f51 (diff)
rbinstall.rb: Show types to install in the help [ci skip]
-rwxr-xr-xtool/rbinstall.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index 90697bfe92..8263eefb0d 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -96,6 +96,20 @@ def parse_args(argv = ARGV)
opt.on('--gnumake') {gnumake = true}
opt.on('--debug-symbols=SUFFIX', /\w+/) {|name| $debug_symbols = ".#{name}"}
+ unless $install_procs.empty?
+ w = (w = ENV["COLUMNS"] and (w = w.to_i) > 80 ? w - 30 : 50)
+ opt.on("\n""Types for --install and --exclude:")
+ mesg = " "
+ $install_procs.each_key do |t|
+ if mesg.size + t.size > w
+ opt.on(mesg)
+ mesg = " "
+ end
+ mesg << " " << t.to_s
+ end
+ opt.on(mesg)
+ end
+
opt.order!(argv) do |v|
case v
when /\AINSTALL[-_]([-\w]+)=(.*)/