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 20238cf commit b92b0a9Copy full SHA for b92b0a9
README.md
@@ -263,6 +263,21 @@ argv.flags.someString // => "hello" (string)
263
argv.flags.someNumber // => [1, 2] (number[])
264
```
265
266
+#### Inverting boolean flags
267
+To explicitly set a boolean flag to `false`, pass in the value using the `=` operator:
268
+
269
+```sh
270
+$ my-script --some-boolean=false
271
+```
272
273
+Without `=`, the `false` will be parsed as a separate argument:
274
275
276
+$ my-script --some-boolean false
277
+# argv.flags.someBoolean => true
278
+# argv._ => ['false']
279
280
281
#### Custom flag types & validation
282
Custom flag types can be created to validate flags and narrow types. Simply create a new function that accepts a string and returns the parsed value.
283
0 commit comments