Project

General

Profile

Feature #17562

Updated by ima1zumi (Mari Imaizumi) 11 months ago

I would like to propose explaining the arguments of the -E option specifically in --help. 

 The current explanation is a bit difficult for beginners to understand. 
 I tried to change `Encoding.default_internal`, but I changed `Encoding.default_external` by mistake. That confused me because I didn't know how to use it. Therefore, I have updated the explanation. 


 before: 
 ``` 
   -Eex[:in], --encoding=ex[:in] 
                   specify the default external and internal character encodings 
 ``` 


 after: 
 ``` 
   -Eexternal-encoding[:internal-encoding], --encoding=external-encoding[:internal-encoding] 
                   specify the default external and internal character encodings 
 ``` 

 diff: 
 ```diff 
 diff --git a/ruby.c b/ruby.c 
 index 5bac96b5e1..4f8975a399 100644 
 --- a/ruby.c 
 +++ b/ruby.c 
 @@ -281,7 +281,7 @@ usage(const char *name, int help, int highlight, int columns) 
         M("-Cdirectory",     "",                       "cd to directory before executing your script"), 
         M("-d",              ", --debug",              "set debugging flags (set $DEBUG to true)"), 
         M("-e 'command'",    "",                       "one line of script. Several -e's allowed. Omit [programfile]"), 
 -         M("-Eex[:in]",       ", --encoding=ex[:in]", "specify the default external and internal character encodings"), 
 +         M("-Eexternal-encoding[:internal-encoding]",", --encoding=external-encoding[:internal-encoding]","specify the default external and internal character encodings"), 
         M("-Fpattern",       "",                       "split() pattern for autosplit (-a)"), 
         M("-i[extension]", "",                       "edit ARGV files in place (make backup if extension supplied)"), 
         M("-Idirectory",     "",                       "specify $LOAD_PATH directory (may be used more than once)"), 
 ``` 

 PR: https://github.com/ruby/ruby/pull/4099

Back