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

An option starting with 'h' causes confusing help output #43

Closed
ChrisMondok opened this issue Nov 14, 2016 · 3 comments
Closed

An option starting with 'h' causes confusing help output #43

ChrisMondok opened this issue Nov 14, 2016 · 3 comments

Comments

@ChrisMondok
Copy link

My app has a config option called 'host'. When you run the program with "-h", the help is printed, which is not unexpected.

However, the following output is

const args = require('args')
  .option('interval', 'How often (in seconds) to ping the device', 30, s => 1000 * s)
  .option('delay', 'How long (in seconds) the device must be gone before reporting no presence', 15 * 60, s => 1000 * s)
  .parse(process.argv)

Note that there are two '-h' options.

@leo
Copy link
Owner

leo commented Dec 8, 2016

The -h flag is used by default in most of the node CLIs. Therefore I highly recommend using a different short version for your "host" flag like this:

.option(['w', 'host'], 'The hostname')

@leo leo closed this as completed Dec 8, 2016
@ChrisMondok
Copy link
Author

ChrisMondok commented Dec 8, 2016

Sorry, I just noticed that I put the code (and the wrong code at that) where the output should be. The output shows two "-h" options.

Obviously I want users to be able to get help. I also want them to set host names. As far as I'm concerned, whichever one the library decides would be fine, but the help output shouldn't imply it does both.

@ChrisMondok
Copy link
Author

It looks like #37 is the same issue.

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