Skip to content

Commit d490247

Browse files
committed
[DOC] Link global variables to command line options
1 parent 21f9a64 commit d490247

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

doc/language/globals.md

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ No \English.
176176
### `$/` (Input Record Separator)
177177

178178
An input record separator, initially newline.
179-
Set by the command-line option `-0`.
179+
Set by the [command-line option `-0`].
180180

181181
Setting to non-nil value by other than the command-line option is
182182
deprecated.
@@ -188,7 +188,9 @@ Aliased as `$-0`.
188188
### `$\` (Output Record Separator)
189189

190190
An output record separator, initially `nil`.
191-
Copied from `$/` when the command-line option `-l` is given.
191+
192+
Copied from `$/` when the [command-line option `-l`] is
193+
given.
192194

193195
Setting to non-nil value by other than the command-line option is
194196
deprecated.
@@ -328,8 +330,8 @@ The value returned by method ARGF.filename.
328330

329331
### `$DEBUG`
330332

331-
Initially `true` if command-line option `-d` or `--debug` is given,
332-
otherwise initially `false`;
333+
Initially `true` if [command-line option `-d`] or
334+
[`--debug`][command-line option `-d`] is given, otherwise initially `false`;
333335
may be set to either value in the running program.
334336

335337
When `true`, prints each raised exception to `$stderr`.
@@ -338,8 +340,8 @@ Aliased as `$-d`.
338340

339341
### `$VERBOSE`
340342

341-
Initially `true` if command-line option `-v` or `-w` is given,
342-
otherwise initially `false`;
343+
Initially `true` if [command-line option `-v`] or
344+
[`-w`][command-line option `-w`] is given, otherwise initially `false`;
343345
may be set to either value, or to `nil`, in the running program.
344346

345347
When `true`, enables Ruby warnings.
@@ -353,7 +355,7 @@ Aliased as `$-v` and `$-w`.
353355
### `$-F`
354356

355357
The default field separator in String#split; must be a String or a
356-
Regexp, and can be set with command-line option `-F`.
358+
Regexp, and can be set with [command-line option `-F`].
357359

358360
Setting to non-nil value by other than the command-line option is
359361
deprecated.
@@ -362,28 +364,28 @@ Aliased as `$;`.
362364

363365
### `$-a`
364366

365-
Whether command-line option `-a` was given; read-only.
367+
Whether [command-line option `-a`] was given; read-only.
366368

367369
### `$-i`
368370

369-
Contains the extension given with command-line option `-i`,
371+
Contains the extension given with [command-line option `-i`],
370372
or `nil` if none.
371373

372374
An alias of ARGF.inplace_mode.
373375

374376
### `$-l`
375377

376-
Whether command-line option `-l` was set; read-only.
378+
Whether [command-line option `-l`] was set; read-only.
377379

378380
### `$-p`
379381

380-
Whether command-line option `-p` was given; read-only.
382+
Whether [command-line option `-p`] was given; read-only.
381383

382384
### `$F`
383385

384-
If the command line option `-a` is given, the array obtained by
385-
splitting `$_` by `$-F` is assigned at the start of each `-l`/`-p`
386-
loop.
386+
If the [command-line option `-a`] is given, the array
387+
obtained by splitting `$_` by `$-F` is assigned at the start of each
388+
`-l`/`-p` loop.
387389

388390
## Deprecated
389391

@@ -594,3 +596,14 @@ Output:
594596
"Bar\n"
595597
"Baz\n"
596598
```
599+
600+
601+
[command-line option `-0`]: rdoc-ref:language/options.md@0-3A+Set+-24-2F+-28Input+Record+Separator-29
602+
[command-line option `-F`]: rdoc-ref:language/options.md@F-3A+Set+Input+Field+Separator
603+
[command-line option `-a`]: rdoc-ref:language/options.md@a-3A+Split+Input+Lines+into+Fields
604+
[command-line option `-d`]: rdoc-ref:language/options.md@d-3A+Set+-24DEBUG+to+true
605+
[command-line option `-i`]: rdoc-ref:language/options.md@i-3A+Set+ARGF+In-Place+Mode
606+
[command-line option `-l`]: rdoc-ref:language/options.md@l-3A+Set+Output+Record+Separator-3B+Chop+Lines
607+
[command-line option `-p`]: rdoc-ref:language/options.md@p-3A+-n-2C+with+Printing
608+
[command-line option `-v`]: rdoc-ref:language/options.md@v-3A+Print+Version-3B+Set+-24VERBOSE
609+
[command-line option `-w`]: rdoc-ref:language/options.md@w-3A+Synonym+for+-W1

0 commit comments

Comments
 (0)