Commander.js: Alias support for Git-style sub-commands

Created on 11 May 2015  路  9Comments  路  Source: tj/commander.js

Aliases don't seem to work _at all_ when using subcommands...

bug

Most helpful comment

@SomeKittens any chance we can get a new release?

All 9 comments

Can you provide an example?

// example.js

#!/usr/bin/env node

var app = require('commander')

app
  .version('1.0.0')
  .command('foo', '...').alias('f')
  .command('bar', '...').alias('b')
  .command('baz', '...').alias('bz')
  .parse(process.argv)
// example-foo.js

#!/usr/bin/env node

console.log('hello foo')
$ ./example.js foo // hello foo
$ ./example.js f // nothing...

It should be "Alias support for Git-style sub-commands".

Any plans on adding this/would authors be open to a PR?

PR is welcome!

Did we determine if this is a bug or lack of feature? The label says bug, but the docs are unclear.

For anyone wondering, a fix for this has been merged into master, but the fix has not been published to npm.

In the meantime, I'm pointing my dependency to the repo:

"commander": "git+https://github.com/tj/commander.js.git"

+1 for releasing with this fix

@SomeKittens any chance we can get a new release?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

goloroden picture goloroden  路  15Comments

jamesgeorge007 picture jamesgeorge007  路  15Comments

open-source-explorer picture open-source-explorer  路  17Comments

sr258 picture sr258  路  14Comments

dresende picture dresende  路  22Comments