Skip to content

Commit ee52a93

Browse files
nobuparacycle
authored andcommitted
[DOC] Fix the combination of custom option and -e
1 parent 742415f commit ee52a93

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

doc/language/options.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,10 @@ Option `-s` specifies that a "custom option" is to define a global variable
437437
in the invoked Ruby program:
438438

439439
- The custom option must appear _after_ the program name.
440+
- If there is no script name in the command line (using {option
441+
-e}[rdoc-ref:@-e+Execute+Given+Ruby+Code] or implicit reading from
442+
`$stdin`), the custom options must be separated from the other
443+
interpreter options with a `--`.
440444
- The custom option must begin with single hyphen (e.g., `-foo`),
441445
not two hyphens (e.g., `--foo`).
442446
- The name of the global variable is based on the option name:
@@ -459,9 +463,6 @@ $ ruby -s t.rb -foo=baz -bar=bat
459463
["baz", "bat"]
460464
```
461465

462-
The option may not be used with
463-
{option -e}[rdoc-ref:@-e+Execute+Given+Ruby+Code]
464-
465466
### `-S`: Search Directories in `ENV['PATH']`
466467

467468
Option `-S` specifies that the Ruby interpreter

0 commit comments

Comments
 (0)