mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ruby.c (proc_options): source-encoding option.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ecc83033ba
commit
ba274d1f46
1 changed files with 9 additions and 0 deletions
9
ruby.c
9
ruby.c
|
@ -960,6 +960,10 @@ proc_options(int argc, char **argv, struct cmdline_options *opt, int envopt)
|
|||
if (!*(s = ++p)) break;
|
||||
set_encoding_part(internal);
|
||||
if (!*(s = ++p)) break;
|
||||
#if ALLOW_DEFAULT_SOURCE_ENCODING
|
||||
set_encoding_part(source);
|
||||
if (!*(s = ++p)) break;
|
||||
#endif
|
||||
rb_raise(rb_eRuntimeError, "extra argument for %s: %s",
|
||||
(arg[1] == '-' ? "--encoding" : "-E"), s);
|
||||
# undef set_encoding_part
|
||||
|
@ -971,6 +975,11 @@ proc_options(int argc, char **argv, struct cmdline_options *opt, int envopt)
|
|||
else if (is_option_with_arg("external-encoding", Qfalse, Qtrue)) {
|
||||
set_external_encoding_once(opt, s, 0);
|
||||
}
|
||||
#if ALLOW_DEFAULT_SOURCE_ENCODING
|
||||
else if (is_option_with_arg("source-encoding", Qfalse, Qtrue)) {
|
||||
set_source_encoding_once(opt, s, 0);
|
||||
}
|
||||
#endif
|
||||
else if (strcmp("version", s) == 0) {
|
||||
if (envopt) goto noenvopt_long;
|
||||
opt->version = 1;
|
||||
|
|
Loading…
Reference in a new issue