Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make requiresArg work with arrays #136

Merged
merged 1 commit into from Oct 6, 2018
Merged

Commits on Sep 28, 2018

  1. fix: make requiresArg work with arrays

    When `requiresArg` was used together with `array`, only the first
    argument of the array would end up being parsed. With this change
    things work as expected.
    
    The `requireArg` option sets the `nargs` options to `1`, so only
    one additional argument will be parsed. The problem was that that
    parsing step was checked before the array parsing one. The solution
    is as simple as flipping those if conditions and check if its an
    array first, hence ignoring the `nargs` option.
    
    Fixes yargs/yargs#1170.
    vmx committed Sep 28, 2018
    Configuration menu
    Copy the full SHA
    6815507 View commit details
    Browse the repository at this point in the history