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

implies doesn't work if value is zero #1203

Closed
lilleyse opened this issue Aug 17, 2018 · 3 comments
Closed

implies doesn't work if value is zero #1203

lilleyse opened this issue Aug 17, 2018 · 3 comments
Labels

Comments

@lilleyse
Copy link

return yargs
    .options({
        longitude: {
            type: 'number'
        },
        latitude: {
            type: 'number'
        }
    })
    .implies('longitude', 'latitude')
    .implies('latitude', 'longitude')
    .argv;

A command like node command.js --longitude=0 proceeds when it should have produced an implication failure message.

@lilleyse
Copy link
Author

Possibly related - a command like node command.js --longitude=0 --latitude=10 fails:

Missing dependent arguments:
 latitude -> longitude

@bcoe bcoe added the bug label Oct 27, 2020
@bcoe
Copy link
Member

bcoe commented Oct 27, 2020

thanks for the bug report. If you're so inclined, would happily take a PR for a failing test, or a fix 😄

@shadowspawn
Copy link
Member

Thanks for the report. This should be fixed by #1985.

Feel free to open a new issue if it comes up again, with new information and renewed interest.

Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants