summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2025-08-07 14:23:07 -0400
committerPeter Zhu <peter@peterzhu.ca>2025-08-13 11:24:50 -0400
commit31ff07ed1eb05d01f7da3c017d542137a3db1e94 (patch)
tree28170cac78f948025a1864eda0cdb5c38b33ddb7 /ruby.c
parent7595ac9a9e8dc460ced50a49e3facaa55a259c35 (diff)
Add link to Ruby options doc in help textHEADmaster
Adds link to https://docs.ruby-lang.org/en/master/ruby/options_md.html in Ruby help text (-h and --help).
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ruby.c b/ruby.c
index 6d2b5833b6..134ac5ae3b 100644
--- a/ruby.c
+++ b/ruby.c
@@ -61,6 +61,7 @@
#include "ruby/util.h"
#include "ruby/version.h"
#include "ruby/internal/error.h"
+#include "version.h"
#define singlebit_only_p(x) !((x) & ((x)-1))
STATIC_ASSERT(Qnil_1bit_from_Qfalse, singlebit_only_p(Qnil^Qfalse));
@@ -403,7 +404,10 @@ usage(const char *name, int help, int highlight, int columns)
unsigned int w = (columns > 80 ? (columns - 79) / 2 : 0) + 16;
#define SHOW(m) show_usage_line(&(m), help, highlight, w, columns)
- printf("%sUsage:%s %s [options] [--] [filepath] [arguments]\n", sb, se, name);
+ printf("%sUsage:%s %s [options] [--] [filepath] [arguments]\n\n", sb, se, name);
+ printf("Details and examples at https://docs.ruby-lang.org/en/%s/ruby/options_md.html\n",
+ RUBY_PATCHLEVEL == -1 ? "master" : STRINGIZE(RUBY_VERSION_MAJOR) "." STRINGIZE(RUBY_VERSION_MINOR));
+
for (i = 0; i < num; ++i)
SHOW(usage_msg[i]);