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

ECKIT-620 Enable multi-value options in CmdArgs #83

Merged
merged 9 commits into from
Nov 18, 2023

Conversation

marcosbento
Copy link
Contributor

This pull request enables the support for multi-value options in CmdArgs.

A multi-value Option allows collecting multiple argv values, as if these values where positional relative to the option e.g. --option <command> <name> <value> /path/to/one /path/to/two ... --next.

The goal is to allow collecting argv values until: 1) there are no more values to collect, either because the end of the list of values was reached or because the next option was found; or, 2) a mandatory+optional number of values has been collected.

pmaciel and others added 2 commits June 19, 2023 00:39
In some ECFLOW cases, command line options are expected to collect multiple values, as if these values where positional relative to the option e.g. --option <command> <name> <value> /path/to/one /path/to/two ... --next. The logic mandates that values are collected until: 1) there are no more values to collect, either because the end of the list of values was reached or because the next option was found; or, 2) a mandatory+optional number of values has been collected.

This implies changes to the way Options are collected by CmdArgs, and the current change enables each kind of option (SimpleOption, VectorOption, etc) to define how and how many argv entries are collected.
@iainrussell iainrussell added the approved-for-ci Approved for CI run label Sep 20, 2023
@codecov-commenter
Copy link

codecov-commenter commented Sep 20, 2023

Codecov Report

Attention: 67 lines in your changes are missing coverage. Please review.

Comparison is base (ba0adda) 62.64% compared to head (fceef17) 62.84%.
Report is 20 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #83      +/-   ##
===========================================
+ Coverage    62.64%   62.84%   +0.20%     
===========================================
  Files          779      789      +10     
  Lines        44303    45169     +866     
===========================================
+ Hits         27753    28386     +633     
- Misses       16550    16783     +233     
Files Coverage Δ
src/eckit/container/BTree.cc 91.63% <ø> (ø)
src/eckit/filesystem/URI.h 100.00% <ø> (ø)
src/eckit/io/PooledHandle.cc 77.85% <100.00%> (ø)
src/eckit/log/JSON.h 60.00% <ø> (ø)
src/eckit/option/FactoryOption.h 100.00% <100.00%> (ø)
src/eckit/option/MultiValueOption.h 100.00% <100.00%> (ø)
src/eckit/option/Option.cc 100.00% <100.00%> (+69.56%) ⬆️
src/eckit/option/SimpleOption.h 100.00% <100.00%> (ø)
src/eckit/option/VectorOption.h 100.00% <100.00%> (ø)
src/eckit/parser/YAMLParser.cc 87.57% <ø> (ø)
... and 15 more

... and 19 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Correct the implementation of Separator to ensure it can be instantiated.
@github-actions github-actions bot removed the approved-for-ci Approved for CI run label Sep 20, 2023
@iainrussell iainrussell added the approved-for-ci Approved for CI run label Sep 20, 2023
@github-actions github-actions bot removed the approved-for-ci Approved for CI run label Sep 22, 2023
@iainrussell iainrussell added the approved-for-ci Approved for CI run label Sep 22, 2023
@pmaciel
Copy link
Member

pmaciel commented Sep 22, 2023

Only remaining the pgen tests!

The ability to set an option's default value using a data member existed before, but was removed in favor of definition of the default value at construction.

Unfortunately, downstream dependencies are using this feature and so the feature was brought back, but only implemented for the classes for which it make sense (e.g. SimpleOption<t> provides it by inheriting it from BaseOption<T>; Separator does not provide).
@github-actions github-actions bot removed the approved-for-ci Approved for CI run label Sep 25, 2023
@pmaciel pmaciel added the approved-for-ci Approved for CI run label Sep 25, 2023
@marcosbento
Copy link
Contributor Author

@pmaciel , @b8raoult

All downstream checks are now passing. Any chance you can have a look at the changes?

@github-actions github-actions bot removed the approved-for-ci Approved for CI run label Oct 27, 2023
@iainrussell iainrussell added the approved-for-ci Approved for CI run label Oct 27, 2023
@pmaciel
Copy link
Member

pmaciel commented Nov 2, 2023

Hi @simondsmart , @b8raoult , @danovaro , shall we merge this? (state what you think)

@danovaro danovaro merged commit 95662f3 into ecmwf:develop Nov 18, 2023
128 of 139 checks passed
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.

6 participants