|
61 | 61 | #include "ruby/util.h" |
62 | 62 | #include "ruby/version.h" |
63 | 63 | #include "ruby/internal/error.h" |
| 64 | +#include "version.h" |
64 | 65 |
|
65 | 66 | #define singlebit_only_p(x) !((x) & ((x)-1)) |
66 | 67 | STATIC_ASSERT(Qnil_1bit_from_Qfalse, singlebit_only_p(Qnil^Qfalse)); |
@@ -305,8 +306,6 @@ ruby_show_usage_line(const char *name, const char *secondary, const char *descri |
305 | 306 | description, help, highlight, width, columns); |
306 | 307 | } |
307 | 308 |
|
308 | | -RUBY_EXTERN const char ruby_api_version_name[]; |
309 | | - |
310 | 309 | static void |
311 | 310 | usage(const char *name, int help, int highlight, int columns) |
312 | 311 | { |
@@ -409,9 +408,9 @@ usage(const char *name, int help, int highlight, int columns) |
409 | 408 | unsigned int w = (columns > 80 ? (columns - 79) / 2 : 0) + 16; |
410 | 409 | #define SHOW(m) show_usage_line(&(m), help, highlight, w, columns) |
411 | 410 |
|
412 | | - printf("%sUsage:%s %s [options] [--] [filepath] [arguments]\n", sb, se, name); |
413 | | - printf("\n""Details and examples at https://docs.ruby-lang.org/en/%s/ruby/options_md.html\n", |
414 | | - ruby_api_version_name); |
| 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)); |
415 | 414 |
|
416 | 415 | for (i = 0; i < num; ++i) |
417 | 416 | SHOW(usage_msg[i]); |
|
0 commit comments