Skip to content

Commit 285e22e

Browse files
committed
Revert "Add link to Ruby options doc in help text"
This reverts commit 31ff07e. * Don't add a test which only runs on production release * https://github.com/ruby/actions/actions/runs/20486784889/job/58870959976 * Don't add a new line to `ruby --help` * ruby#14142 (comment)
1 parent ba2f697 commit 285e22e

File tree

3 files changed

+4
-21
lines changed

3 files changed

+4
-21
lines changed

doc/language/options.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
<!---
2-
CAUTION
3-
4-
This page on docs.ruby-lang.org is displayed in Ruby's help message (-h and --help).
5-
Please make sure you update the link when renaming or moving this file.
6-
--->
7-
81
# Ruby Command-Line Options
92

103
## About the Examples

ruby.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
#include "ruby/util.h"
6262
#include "ruby/version.h"
6363
#include "ruby/internal/error.h"
64-
#include "version.h"
6564

6665
#define singlebit_only_p(x) !((x) & ((x)-1))
6766
STATIC_ASSERT(Qnil_1bit_from_Qfalse, singlebit_only_p(Qnil^Qfalse));
@@ -408,10 +407,7 @@ usage(const char *name, int help, int highlight, int columns)
408407
unsigned int w = (columns > 80 ? (columns - 79) / 2 : 0) + 16;
409408
#define SHOW(m) show_usage_line(&(m), help, highlight, w, columns)
410409

411-
printf("%sUsage:%s %s [options] [--] [filepath] [arguments]\n\n", sb, se, name);
412-
printf("Details and examples at https://docs.ruby-lang.org/en/%s/ruby/options_md.html\n",
413-
RUBY_PATCHLEVEL == -1 ? "master" : STRINGIZE(RUBY_VERSION_MAJOR) "." STRINGIZE(RUBY_VERSION_MINOR));
414-
410+
printf("%sUsage:%s %s [options] [--] [filepath] [arguments]\n", sb, se, name);
415411
for (i = 0; i < num; ++i)
416412
SHOW(usage_msg[i]);
417413

test/ruby/test_rubyoptions.rb

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,18 @@ def test_source_file
4949

5050
def test_usage
5151
assert_in_out_err(%w(-h)) do |r, e|
52-
assert_operator(r.size, :<=, 26)
53-
longer = r[3..-1].select {|x| x.size >= 80}
52+
assert_operator(r.size, :<=, 25)
53+
longer = r[1..-1].select {|x| x.size >= 80}
5454
assert_equal([], longer)
5555
assert_equal([], e)
56-
57-
version = RUBY_PATCHLEVEL == -1 ? "master" : "#{RUBY_VERSION_MAJOR}.#{RUBY_VERSION_MINOR}"
58-
assert_include(r, "Details and examples at https://docs.ruby-lang.org/en/#{version}/ruby/options_md.html")
5956
end
6057
end
6158

6259
def test_usage_long
6360
assert_in_out_err(%w(--help)) do |r, e|
64-
longer = r[3..-1].select {|x| x.size > 80}
61+
longer = r[1..-1].select {|x| x.size > 80}
6562
assert_equal([], longer)
6663
assert_equal([], e)
67-
68-
version = RUBY_PATCHLEVEL == -1 ? "master" : "#{RUBY_VERSION_MAJOR}.#{RUBY_VERSION_MINOR}"
69-
assert_include(r, "Details and examples at https://docs.ruby-lang.org/en/#{version}/ruby/options_md.html")
7064
end
7165
end
7266

0 commit comments

Comments
 (0)