We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ce0a32 commit f1f43a3Copy full SHA for f1f43a3
README.md
@@ -275,6 +275,20 @@ node cli.js --extraneous true
275
Unknown or unexpected option: --extraneous
276
```
277
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
292
# License
293
294
Copyright © 2017-2019 by ZEIT, Inc. Released under the [MIT License](LICENSE.md).
0 commit comments