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

Added mandatory (or required) option #177

Merged
merged 29 commits into from
Feb 18, 2021
Merged

Added mandatory (or required) option #177

merged 29 commits into from
Feb 18, 2021

Conversation

PoloLacoste
Copy link
Contributor

@PoloLacoste PoloLacoste commented Jan 5, 2021

Simple usage :

var parser = ArgParser();
parser.addOption('flag', mandatory: true);

If the parser parse arguments without this option it will throw a FormatException.

Closes #156

@google-cla
Copy link

google-cla bot commented Jan 5, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Jan 5, 2021
@PoloLacoste
Copy link
Contributor Author

@googlebot I signed it!

@google-cla google-cla bot added cla: yes and removed cla: no labels Jan 5, 2021
@PoloLacoste PoloLacoste changed the title Added mandatory (required) options Added mandatory (or required) options Jan 5, 2021
@PoloLacoste PoloLacoste changed the title Added mandatory (or required) options Added mandatory (or required) option Jan 5, 2021
@grouma grouma self-requested a review January 7, 2021 18:00
@grouma
Copy link
Member

grouma commented Jan 7, 2021

Thanks for the PR!

Could you add a CHANGELOG entry and update the version in the pubspec?

lib/src/arg_parser.dart Outdated Show resolved Hide resolved
lib/src/arg_parser.dart Outdated Show resolved Hide resolved
lib/src/option.dart Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
example/test_runner.dart Show resolved Hide resolved
lib/src/parser.dart Outdated Show resolved Hide resolved
lib/src/usage.dart Outdated Show resolved Hide resolved
lib/src/usage.dart Show resolved Hide resolved
PoloLacoste and others added 4 commits January 7, 2021 20:29
fix typo cannot

Co-authored-by: Nate Bosch <nbosch1@gmail.com>
Co-authored-by: Nate Bosch <nbosch1@gmail.com>
Co-authored-by: Nate Bosch <nbosch1@gmail.com>
Co-authored-by: Nate Bosch <nbosch1@gmail.com>
PoloLacoste and others added 5 commits January 7, 2021 20:31
Co-authored-by: Nate Bosch <nbosch1@gmail.com>
Co-authored-by: Nate Bosch <nbosch1@gmail.com>
Co-authored-by: Nate Bosch <nbosch1@gmail.com>
lib/src/arg_parser.dart Outdated Show resolved Hide resolved
@natebosch
Copy link
Member

Sorry for the churn here. After some internal discussion we think that mandatory is indeed a better name to avoid confusion with the keyword. I've handled the rename back and the merge conflicts from other recent changes.

lib/src/arg_parser.dart Outdated Show resolved Hide resolved
@natebosch natebosch merged commit eb2deca into dart-lang:master Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow making options required
4 participants