Skip to content

Commit

Permalink
Merge pull request #63 from lydell/dash-dash-docs-fix
Browse files Browse the repository at this point in the history
move the `opts['--']` example back where it belongs
  • Loading branch information
James Halliday committed Aug 29, 2015
2 parents dc62448 + 5fa440e commit 4cf45a2
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,20 @@ argument names to use as aliases
first non-option
* `opts['--']` - when true, populate `argv._` with everything before the `--`
and `argv['--']` with everything after the `--`. Here's an example:

```
> require('./')('one two three -- four five --six'.split(' '), { '--': true })
{ _: [ 'one', 'two', 'three' ],
'--': [ 'four', 'five', '--six' ] }
```

Note that with `opts['--']` set, parsing for arguments still stops after the
`--`.

* `opts.unknown` - a function which is invoked with a command line parameter not
defined in the `opts` configuration object. If the function returns `false`, the
unknown option is not added to `argv`.

```
> require('./')('one two three -- four five --six'.split(' '), { '--': true })
{ _: [ 'one', 'two', 'three' ],
'--': [ 'four', 'five', '--six' ] }
```

Note that with `opts['--']` set, parsing for arguments still stops after the
`--`.

# install

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

0 comments on commit 4cf45a2

Please sign in to comment.