Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: do not set boolean flags if not defined in
argv
BREAKING CHANGE: `boolean` flags defined without a `default` value will now be set to `undefined` instead of `false` when the user doesn't set the corresponding CLI arg. Previous behavior: ```js var parse = require('yargs-parser'); parse('--flag', {boolean: ['flag']}); // => { _: [], flag: true } parse('--no-flag', {boolean: ['flag']}); // => { _: [], flag: false } parse('', {boolean: ['flag']}); // => { _: [], flag: false } ``` New behavior: ```js var parse = require('yargs-parser'); parse('--flag', {boolean: ['flag']}); // => { _: [], flag: true } parse('--no-flag', {boolean: ['flag']}); // => { _: [], flag: false } parse('', {boolean: ['flag']}); // => { _: [] } => flag not set similarly to other option type ```
- Loading branch information