ruby.c: show help messages of --dump

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
sonots 2017-09-20 05:01:09 +00:00
Родитель 71345cf1df
Коммит c18503c25a
1 изменённых файлов: 17 добавлений и 6 удалений

15
ruby.c
Просмотреть файл

@ -241,13 +241,21 @@ usage(const char *name, int help)
};
static const struct message help_msg[] = {
M("--copyright", "", "print the copyright"),
M("--enable=feature[,...]", ", --disable=feature[,...]",
"enable or disable features"),
M("--dump={insns|parsetree|...}[,...]", "",
"dump debug information. see below for available dump list"),
M("--enable={gems|rubyopt|...}[,...]", ", --disable={gems|rubyopt|...}[,...]",
"enable or disable features. see below for available features"),
M("--external-encoding=encoding", ", --internal-encoding=encoding",
"specify the default external or internal character encoding"),
M("--version", "", "print the version"),
M("--help", "", "show this message, -h for short message"),
};
static const struct message dumps[] = {
M("insns", "", "instruction sequences"),
M("yydebug", "", "yydebug of yacc parser generator"),
M("parsetree", "", "AST"),
M("parsetree_with_comment", "", "AST with comments"),
};
static const struct message features[] = {
M("gems", "", "rubygems (default: "DEFAULT_RUBYGEMS_ENABLED")"),
M("did_you_mean", "", "did_you_mean (default: "DEFAULT_RUBYGEMS_ENABLED")"),
@ -266,6 +274,9 @@ usage(const char *name, int help)
for (i = 0; i < numberof(help_msg); ++i)
SHOW(help_msg[i]);
puts("Dump List:");
for (i = 0; i < numberof(dumps); ++i)
SHOW(dumps[i]);
puts("Features:");
for (i = 0; i < numberof(features); ++i)
SHOW(features[i]);