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

Added alias feature #210

Merged
merged 4 commits into from
Jul 16, 2014
Merged

Added alias feature #210

merged 4 commits into from
Jul 16, 2014

Conversation

tandrewnichols
Copy link
Contributor

Adds an alias feature:

program
  .command('remove <target>')
  .alias('rm')
  .description('Remove target <target>')
  .action(function() {
    /* Take action */
  });

Also cleans up commandHelp a little. At least for me, it never looks pretty because

command [options] <arg>

is almost always longer than the given 22 space padding, so each command lines up differently. Plus, with adding an alias, it gets even longer. This just breaks the description onto a separate line, with a bit of padding at the front (and adds a newline after each command).

@davidglivar
Copy link

+1

@mattma
Copy link

mattma commented Jul 11, 2014

This is nice, why it did not get merged?

@SomeKittens
Copy link
Collaborator

@mattma Commander.js is under new management, so things are still a bit shaky. Great PR, but there are conflicts with the current version. Bring it up to date and I'll merge it in.

@tandrewnichols
Copy link
Contributor Author

Do you prefer this interface or the one in #64? I'm happy to update if this will actually be used.

@SomeKittens
Copy link
Collaborator

@tandrewnichols I like this one better - the syntax is a little clearer. I'll close the other one. Thanks!

SomeKittens added a commit that referenced this pull request Jul 16, 2014
@SomeKittens SomeKittens merged commit 33db110 into tj:master Jul 16, 2014
@SomeKittens
Copy link
Collaborator

@tandrewnichols Thanks!

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.

4 participants