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

default .demand message has counts, provided one can't? #431

Closed
ljharb opened this issue Mar 11, 2016 · 4 comments
Closed

default .demand message has counts, provided one can't? #431

ljharb opened this issue Mar 11, 2016 · 4 comments

Comments

@ljharb
Copy link
Contributor

ljharb commented Mar 11, 2016

How can I do .demand(n, msg) such that msg can contain a count of the number of non-option arguments provided?

@bcoe
Copy link
Member

bcoe commented Mar 13, 2016

@ljharb I like the idea of being able to have a simple placeholder in your message, such as:

%i, but this feature doesn't yet exist.

@ljharb
Copy link
Contributor Author

ljharb commented Mar 14, 2016

That's exactly what i was thinking - just like usage has $0.

@ljharb
Copy link
Contributor Author

ljharb commented Mar 14, 2016

I went ahead and made a PR - please let me know your thoughts!

@bcoe
Copy link
Member

bcoe commented Nov 9, 2019

demand has now been split into demandCommand and demandOption, the first for positional arguments, and the latter for options.

https://github.com/yargs/yargs/blob/master/docs/api.md#demandoptionkey-msg

@bcoe bcoe closed this as completed Nov 9, 2019
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