Skip to content

Commit

Permalink
docs: supply an array as option value
Browse files Browse the repository at this point in the history
fix #24
  • Loading branch information
egoist committed Dec 2, 2018
1 parent 98f9c25 commit 6c32138
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- [Variadic Arguments](#variadic-arguments)
- [Dot-nested Options](#dot-nested-options)
- [Default Command](#default-command)
- [Supply an array as option value](#supply-an-array-as-option-value)
- [With TypeScript](#with-typescript)
- [Projects Using CAC](#projects-using-cac)
- [References](#references)
Expand Down Expand Up @@ -211,6 +212,18 @@ cli
cli.parse()
```

### Supply an array as option value

```bash
node cli.js --include project-a
# The parsed options will be:
# { include: 'project-a' }

node cli.js --include project-a --include project-b
# The parsed options will be:
# { include: ['project-a', 'project-b'] }
```

### With TypeScript

First you need `@types/node` to be installed as a dev dependency in your project:
Expand Down

0 comments on commit 6c32138

Please sign in to comment.