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

Aliases with multiple characters break things #8

Closed
jsumners opened this issue Jan 23, 2018 · 2 comments
Closed

Aliases with multiple characters break things #8

jsumners opened this issue Jan 23, 2018 · 2 comments

Comments

@jsumners
Copy link

jsumners commented Jan 23, 2018

foo.js

const prog = require('sade')('prog')

prog
  .command('foo', 'do foo thing')
  .option('--foobar -fb', 'add foobar thing')

prog.parse(process.argv)
node foo.js foo --help 

  Description
    do foo thing

  Usage
    $ prog foo [options]

  Options
    -foobar, --fb    add foobar thing
    -h, --help       Displays this message

Notice that what should be --foobar is -foobar and what should be -fb is --fb.

Additionally:

const prog = require('sade')('prog')

prog
  .command('foo', 'do foo thing')
  .option('--foo-bar -f', 'add foobar thing')

prog.parse(process.argv)
node foo.js foo --help

  Description
    do foo thing

  Usage
    $ prog foo [options]

  Options
    -f, --foobar    add foobar thing
    -h, --help      Displays this message

Notice that what should be --foo-bar is --foobar.

@lukeed
Copy link
Owner

lukeed commented Jan 28, 2018

Hey~! Sorry for the delay 🙈

For your first point: Aliases are only meant to be single characters. That follows the Utility Syntax guidline. A -fb is actually a shorter way to write -f -b.

I'll look into the second report~! That doesn't look right and should be handled.

Thanks!

@lukeed
Copy link
Owner

lukeed commented Jan 28, 2018

Yup! Tracking that issue separately. Thank you for pointing this out 🙌

@lukeed lukeed closed this as completed Jan 28, 2018
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

No branches or pull requests

2 participants