Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: yargs/yargs-parser
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v9.0.2
Choose a base ref
...
head repository: yargs/yargs-parser
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v10.0.0
Choose a head ref
  • 2 commits
  • 4 files changed
  • 2 contributors

Commits on Apr 4, 2018

  1. fix: do not set boolean flags if not defined in argv (#119)

    BREAKING CHANGE: `boolean` flags defined without a `default` value will now behave like other option type and won't be set in the parsed results 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
    ```
    pvdlg authored and bcoe committed Apr 4, 2018
    Configuration menu
    Copy the full SHA
    f6e6599 View commit details
    Browse the repository at this point in the history
  2. chore(release): 10.0.0

    Benjamin Coe committed Apr 4, 2018
    Configuration menu
    Copy the full SHA
    8c9706f View commit details
    Browse the repository at this point in the history
Loading