mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 04:07:58 +00:00
Reapply "Extract ruby_api_version_name"
This reverts commit ba2f6972193cdbd7c1e77e26212513e47926b115. Box already used ruby_api_version_name.
This commit is contained in:
parent
285e22edc5
commit
29ffc5d624
5
ruby.c
5
ruby.c
@ -305,6 +305,8 @@ ruby_show_usage_line(const char *name, const char *secondary, const char *descri
|
||||
description, help, highlight, width, columns);
|
||||
}
|
||||
|
||||
RUBY_EXTERN const char ruby_api_version_name[];
|
||||
|
||||
static void
|
||||
usage(const char *name, int help, int highlight, int columns)
|
||||
{
|
||||
@ -408,6 +410,9 @@ usage(const char *name, int help, int highlight, int columns)
|
||||
#define SHOW(m) show_usage_line(&(m), help, highlight, w, columns)
|
||||
|
||||
printf("%sUsage:%s %s [options] [--] [filepath] [arguments]\n", sb, se, name);
|
||||
printf("\n""Details and examples at https://docs.ruby-lang.org/en/%s/ruby/options_md.html\n",
|
||||
ruby_api_version_name);
|
||||
|
||||
for (i = 0; i < num; ++i)
|
||||
SHOW(usage_msg[i]);
|
||||
|
||||
|
||||
10
version.c
10
version.c
@ -25,8 +25,9 @@
|
||||
|
||||
#ifdef RUBY_REVISION
|
||||
# if RUBY_PATCHLEVEL == -1
|
||||
# define RUBY_API_VERSION_NAME "master"
|
||||
# ifndef RUBY_BRANCH_NAME
|
||||
# define RUBY_BRANCH_NAME "master"
|
||||
# define RUBY_BRANCH_NAME RUBY_API_VERSION_NAME
|
||||
# endif
|
||||
# define RUBY_REVISION_STR " "RUBY_BRANCH_NAME" "RUBY_REVISION
|
||||
# else
|
||||
@ -36,6 +37,9 @@
|
||||
# define RUBY_REVISION "HEAD"
|
||||
# define RUBY_REVISION_STR ""
|
||||
#endif
|
||||
#ifndef RUBY_API_VERSION_NAME
|
||||
# define RUBY_API_VERSION_NAME RUBY_API_VERSION_STR
|
||||
#endif
|
||||
#if !defined RUBY_RELEASE_DATETIME || RUBY_PATCHLEVEL != -1
|
||||
# undef RUBY_RELEASE_DATETIME
|
||||
# define RUBY_RELEASE_DATETIME RUBY_RELEASE_DATE
|
||||
@ -45,6 +49,9 @@
|
||||
#define MKSTR(type) rb_obj_freeze(rb_usascii_str_new_static(ruby_##type, sizeof(ruby_##type)-1))
|
||||
#define MKINT(name) INT2FIX(ruby_##name)
|
||||
|
||||
#define RUBY_API_VERSION_STR \
|
||||
STRINGIZE(RUBY_API_VERSION_MAJOR) "." \
|
||||
STRINGIZE(RUBY_API_VERSION_MINOR)
|
||||
const int ruby_api_version[] = {
|
||||
RUBY_API_VERSION_MAJOR,
|
||||
RUBY_API_VERSION_MINOR,
|
||||
@ -77,6 +84,7 @@ const char ruby_revision[] = RUBY_FULL_REVISION;
|
||||
const char ruby_release_date[] = RUBY_RELEASE_DATE;
|
||||
const char ruby_platform[] = RUBY_PLATFORM;
|
||||
const int ruby_patchlevel = RUBY_PATCHLEVEL;
|
||||
const char ruby_api_version_name[] = RUBY_API_VERSION_NAME;
|
||||
const char ruby_description[] =
|
||||
"ruby " RUBY_VERSION RUBY_PATCHLEVEL_STR " "
|
||||
"(" RUBY_RELEASE_DATETIME RUBY_REVISION_STR ") "
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user