Skip to content

Commit 5fa440e

Browse files
committed
move the opts['--'] example back where it belongs
It was accidentally separated from the `opts['--']` bullet point be the new option added in commit 6f3cc5d.
1 parent dc62448 commit 5fa440e

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

readme.markdown

+10-9
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,20 @@ argument names to use as aliases
6565
first non-option
6666
* `opts['--']` - when true, populate `argv._` with everything before the `--`
6767
and `argv['--']` with everything after the `--`. Here's an example:
68+
69+
```
70+
> require('./')('one two three -- four five --six'.split(' '), { '--': true })
71+
{ _: [ 'one', 'two', 'three' ],
72+
'--': [ 'four', 'five', '--six' ] }
73+
```
74+
75+
Note that with `opts['--']` set, parsing for arguments still stops after the
76+
`--`.
77+
6878
* `opts.unknown` - a function which is invoked with a command line parameter not
6979
defined in the `opts` configuration object. If the function returns `false`, the
7080
unknown option is not added to `argv`.
7181

72-
```
73-
> require('./')('one two three -- four five --six'.split(' '), { '--': true })
74-
{ _: [ 'one', 'two', 'three' ],
75-
'--': [ 'four', 'five', '--six' ] }
76-
```
77-
78-
Note that with `opts['--']` set, parsing for arguments still stops after the
79-
`--`.
80-
8182
# install
8283

8384
With [npm](https://npmjs.org) do:

0 commit comments

Comments
 (0)