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

Unable to call argv.showHelp to show argv usage #275

Open
Telokis opened this issue Oct 12, 2017 · 3 comments
Open

Unable to call argv.showHelp to show argv usage #275

Telokis opened this issue Oct 12, 2017 · 3 comments

Comments

@Telokis
Copy link

Telokis commented Oct 12, 2017

I am trying to call argv.showHelp in order to display which arguments are available to the user.

However, if I do nconf.argv().showHelp(); it crashes.

I tried reading the source code and I really expect this to work but it won't.

@mhamann
Copy link
Collaborator

mhamann commented Oct 12, 2017

nconf.argv() returns an instance of nconf so you can chain calls together.

You can access the help via nconf.argv().stores.argv.showHelp(); however, this is designed to be handled by a formatter, so the results may not be terribly useful to you.

@Telokis
Copy link
Author

Telokis commented Oct 12, 2017

Could it be possible for nconf to accept an optional usage argument/option to be passed to yargs so that yargs can automatically handle --help?

@mhamann
Copy link
Collaborator

mhamann commented Oct 22, 2017

@Telokis sounds like that could be a good enhancement. Why not take a look at the source and submit a PR?

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