Skip to content

No check for mandatory when using option #101

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
ookami-kb opened this issue Jun 14, 2024 · 2 comments · Fixed by #871
Closed

No check for mandatory when using option #101

ookami-kb opened this issue Jun 14, 2024 · 2 comments · Fixed by #871

Comments

@ookami-kb
Copy link

ookami-kb commented Jun 14, 2024

When using argResults['foo'] there's a check for mandatory option:

if (option.mandatory && !_parsed.containsKey(name)) {
  throw ArgumentError('Option $name is mandatory.');
}

But the new strictly typed argResults.option('foo') doesn't have this check.

@christerswahn
Copy link

👍

@mosuem mosuem transferred this issue from dart-archive/args Oct 14, 2024
@TheMaverickProgrammer
Copy link

TheMaverickProgrammer commented Feb 5, 2025

Same problem. This is wildly unintuitive and unexpected. A simple check for mandatory inputs during parse() would be ideal too.

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

Successfully merging a pull request may close this issue.

4 participants