Yargs: Add `-h` short option

Created on 3 Oct 2017  路  4Comments  路  Source: yargs/yargs

Could we have an -h short option, equivalent to --help?

Most helpful comment

@alexreg @Morishiri I thought about this when I made --help default to enabled. my main concern is that I think it's too likely that -h will collide with people's existing configurations (--help and `--version are specific enough that I thought it was safe).

You can totally just add .alias('h', 'help') to your configuration though, to get the effect.

All 4 comments

@bcoe what do you think about that?
What about programs which are using h as alias for some command already? Will it break them?

It could be configurable, of course. :-)

@alexreg @Morishiri I thought about this when I made --help default to enabled. my main concern is that I think it's too likely that -h will collide with people's existing configurations (--help and `--version are specific enough that I thought it was safe).

You can totally just add .alias('h', 'help') to your configuration though, to get the effect.

Ah right, that should do the job then. Thanks!

Was this page helpful?
0 / 5 - 0 ratings