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

Fail when using same command and alias #491

Merged
merged 1 commit into from
Aug 9, 2017

Conversation

ajfranzoia
Copy link
Contributor

Fixes #490. Prevents running a command twice when -accidentally- using same command alias and name.

@ajfranzoia ajfranzoia force-pushed the fix-same-command-alias branch from ce848a6 to 1932f4b Compare January 25, 2016 04:47
@deian
Copy link

deian commented Jan 26, 2016

LGTM. Thanks for doing this. The only thing I would point out is a style difference: it seems like the rest of the file doesn't use curly braces for a single-statement if. (Though I'm in no position other than to informally comment.)

@ajfranzoia
Copy link
Contributor Author

@SomeKittens Let me know if there's anything that needs modification (same for #492 and #494)

@hellowin
Copy link

@ajfranzoia I think what @deian said is, you just need to change

if (alias === this._name) {
  throw new Error('Command alias can\'t be the same as its name');
}

to

if (alias === this._name) throw new Error('Command alias can\'t be the same as its name');

@abetomo
Copy link
Collaborator

abetomo commented Aug 3, 2017

@ajfranzoia
Could you please resolve the conflict?

@ajfranzoia ajfranzoia force-pushed the fix-same-command-alias branch 2 times, most recently from ddf5ce7 to e636703 Compare August 8, 2017 20:35
@ajfranzoia
Copy link
Contributor Author

@abetomo done!

@ajfranzoia ajfranzoia force-pushed the fix-same-command-alias branch from e636703 to 2e329a3 Compare August 8, 2017 20:39
@abetomo
Copy link
Collaborator

abetomo commented Aug 9, 2017

Thank you!

@abetomo abetomo merged commit 2f07e29 into tj:master Aug 9, 2017
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.

5 participants