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 application with no commands shows [commands] usage #42

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

An application with no commands shows [commands] usage #42

ChrisMondok opened this issue Nov 14, 2016 · 4 comments

Comments

@ChrisMondok
Copy link

My application accepts no commands, but has options. The setup looks like this

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)

However, when I run the app with --help, the output looks like this

[chris:~/device-presence] master(+6/-1) ± node index.js --help

  Usage: index.js [options] [command]

  Commands:

    help  Display help

  Options:

    -d, --delay <n>     How long (in seconds) the device must be gone before reporting no presence
    -h, --help          Output usage information
    -i, --interval <n>  How often (in seconds) to ping the device
    -v, --version       Output the version number

Since my application does not use commands, it would be nice if the usage section did not imply that it did.

@leo
Copy link
Owner

leo commented Dec 8, 2016

You don't want people to take advantage of the "help" command?

@ChrisMondok
Copy link
Author

I want people to be able to get help, but I find the output confusing. Isn't a command usually a bare word? Like "merge" in "git merge"?

@leo
Copy link
Owner

leo commented Dec 8, 2016

Check this out. It's a binary with no sub commands.

@leo
Copy link
Owner

leo commented Feb 10, 2017

We still need to support the help command. It's important for making it easy for people to discover how to use a CLI program.

@leo leo closed this as completed Feb 10, 2017
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