Skip to content

Commit f1f43a3

Browse files
committed
add faq (closes #45)
1 parent 3ce0a32 commit f1f43a3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,20 @@ node cli.js --extraneous true
275275
Unknown or unexpected option: --extraneous
276276
```
277277

278+
# FAQ
279+
280+
A few questions and answers that have been asked before:
281+
282+
### How do I require an argument with `arg`?
283+
284+
Do the assertion yourself, such as:
285+
286+
```javascript
287+
const args = arg({ '--name': String });
288+
289+
if (!args['--name']) throw new Error('missing required argument: --name');
290+
```
291+
278292
# License
279293

280294
Copyright © 2017-2019 by ZEIT, Inc. Released under the [MIT License](LICENSE.md).

0 commit comments

Comments
 (0)