@@ -129,6 +129,24 @@ $ basename `pwd`
129129ruby
130130```
131131
132+ This option is accumulative; relative paths are solved from the
133+ previous working directory.
134+
135+ ``` console
136+ $ ruby -C / -C usr -e ' puts Dir.pwd'
137+ /usr
138+ ```
139+
140+ If the argument is not an existing directory, a fatal error will
141+ occur:
142+
143+ ``` console
144+ $ ruby -C /nonexistent
145+ ruby: Can't chdir to /nonexistent (fatal)
146+ $ ruby -C /dev/null
147+ ruby: Can't chdir to /dev/null (fatal)
148+ ```
149+
132150Whitespace between the option and its argument may be omitted.
133151
134152### ` -d ` : Set ` $DEBUG ` to ` true `
@@ -273,6 +291,16 @@ $ ruby -I my_lib -I some_lib -e 'p $LOAD_PATH.take(2)'
273291$ popd
274292```
275293
294+ This option and {option ` -C ` }[ rdoc-ref:@-C+Set+Working+Directory] will
295+ be applied in the order in the command line; expansion of ` -I ` options
296+ are affected by preceeding ` -C ` options.
297+
298+ ``` console
299+ $ ruby -C / -Ilib -C usr -Ilib -e ' puts $:[0, 2]'
300+ /lib
301+ /usr/lib
302+ ```
303+
276304Whitespace between the option and its argument may be omitted.
277305
278306### ` -l ` : Set Output Record Separator; Chop Lines
@@ -396,6 +424,11 @@ $ ruby -r csv -r json -e 'p defined?(JSON); p defined?(CSV)'
396424"constant"
397425```
398426
427+ The library is loaded with the ` Kernel#require ` method, after the
428+ other options such as {` -C ` }[ rdoc-ref:@-C+Set+Working+Directory] ,
429+ {` -I ` }[ rdoc-ref:@-I+Add+to+LOADPATH] , and "custom options" by
430+ {` -s ` }[ rdoc-ref:@-s+Define+Global+Variable] , are applied:
431+
399432Whitespace between the option and its argument may be omitted.
400433
401434### ` -s ` : Define Global Variable
0 commit comments