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

Is it possible to make input required? #221

Open
KonradLinkowski opened this issue Dec 16, 2022 · 3 comments
Open

Is it possible to make input required? #221

KonradLinkowski opened this issue Dec 16, 2022 · 3 comments

Comments

@KonradLinkowski
Copy link

No description provided.

@sindresorhus
Copy link
Owner

That's not currently possible. It's easy enough to check the input manually and throw an error if it's not valid.

@tommy-mitchell
Copy link
Contributor

tommy-mitchell commented Mar 21, 2023

Since this is simple to do, it’d make it all the more convenient for meow to support this. It could be an option (like isRequired for flags):

const cli = meow({
  // …
  inputIsRequired: true,
});

I think a simple boolean would be enough, but a function could be accepted like IsRequired for completeness.

@sindresorhus
Copy link
Owner

We may want more options for the input in the future, so I would go with {input: {isRequired: true}}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants