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

docs(api): clarify process.argv handling and the order of API methods #1644

Merged
merged 3 commits into from Jun 6, 2020

Conversation

roryokane
Copy link
Contributor

The final statement “the rest of these methods below come in just before …” now makes sense for both of these argument-passing styles:

  • require('yargs').argv
  • require('yargs').parse()

There is one more argument-passing style I’m not sure how to handle:

  • require('yargs')([ '-x', '1', '-y', '2' ])

I think I once tried putting methods earlier in the chain like require('yargs').help().([ '-x', '1', '-y', '2' ]) and got an error. If anyone knows the correct place to put the chain methods like .option when passing arguments the above way, I can update this PR to describe it.

@bcoe bcoe requested a review from mleguen June 2, 2020 20:58
@bcoe
Copy link
Member

bcoe commented Jun 2, 2020

@roryokane this seems like a reasonable clarification to me, I'll wait for @mleguen to chime in too.

Copy link
Member

@mleguen mleguen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @roryokane

docs/api.md Outdated Show resolved Hide resolved
Copy link
Member

@mleguen mleguen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again

@mleguen mleguen merged commit 18c2efd into yargs:master Jun 6, 2020
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

Successfully merging this pull request may close these issues.

None yet

3 participants