8000 Unable to call argv.showHelp to show argv usage · Issue #275 · indexzero/nconf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

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

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

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

Telokis opened this issue Oct 12, 2017 · 4 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?

@peternewman
Copy link

Is it still the case that there's no way to auto-generate some usage info based on the nconf data passed in (and potential defaults)?

I found it a bit confusing on a tool using this that --help only offers two options when it supports lots more.

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

3 participants
0