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

Require an option #909

Closed
dzek69 opened this issue Jan 22, 2019 · 2 comments
Closed

Require an option #909

dzek69 opened this issue Jan 22, 2019 · 2 comments

Comments

@dzek69
Copy link

dzek69 commented Jan 22, 2019

Can I define option as required?
I want to create ffmpeg-like cli experience and want person to always include -i option with a value. I can manually detect that -i wasn't given, but I want commander to do it for me.
Is it possible?

If yes - then I think README and API Docs need some examples, if not - I'd like make this a feature request.

Example

program .option("-i <path>", "source file")

This fails on:
app -i

but continues on:
app

@shadowspawn
Copy link
Collaborator

shadowspawn commented Jan 23, 2019

No, this is not currently supported.

There are some Issues (#230) and Pull Requests (#462 #503) about required arguments and required options.

@shadowspawn
Copy link
Collaborator

Answer provided, and enhancement covered by existing issue. Closing in favour of #230

Duplicate of #230

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