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

handle edge-cases when setting alias keys #291

Merged
merged 3 commits into from
Nov 14, 2015
Merged

handle edge-cases when setting alias keys #291

merged 3 commits into from
Nov 14, 2015

Conversation

bcoe
Copy link
Member

@bcoe bcoe commented Nov 8, 2015

In the ongoing effort to make yargs unsinkable, this pull request handles edge-cases when setting aliases. This behavior used to fail:

var argv = require('yargs')
  .alias('x', 'y')
  .alias('y', 'z')

As did this:

var argv = require('yargs')
  .alias('z', 'zm')
  .alias('zoom', 'zoop')
  .alias('zm', 'zoom')

We're now clever about merging together alias groups as aliases are defined, solving these transitive edge-cases ... definitely an edge case, but I'm a bit OCD about making yargs handle every edge-case I think of!

reviewers: @nexdrew

argv.should.have.property('f', 11)
})

it('should merge two lists of aliases if the collide', function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/the/they/

@nexdrew
Copy link
Member

nexdrew commented Nov 8, 2015

@bcoe You're a bit crazy, but I like your style! 👍

@nexdrew
Copy link
Member

nexdrew commented Nov 8, 2015

LGTM :shipit:

bcoe added a commit that referenced this pull request Nov 14, 2015
handle edge-cases when setting alias keys
@bcoe bcoe merged commit 3178297 into master Nov 14, 2015
@bcoe bcoe deleted the transitive-alias branch November 14, 2015 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants