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

Extend the functionalities of the command line parameters #1988

Merged
merged 24 commits into from
Feb 18, 2025

Conversation

AlexlHer
Copy link
Member

Short changelog :

  • Add a minimal help for the Arcane-based app (./app -h or ./app --help). Need to be extend;
  • Extend the symbol replacement to the entire dataset (for option types : simple / service (for @name and @mesh-name) / extended / enum) :

Exemple : option <my-option>@MyValue@</my-option> with parameter ./app -A,MyValue=3.0 dataset.arc replaces @MyValue@ with 3.0 (so : <my-option>3.0</my-option>)

  • Add support for the mesh-name service attribute in the dataset :

To change the mesh used by the service instance, you can change it in the dataset (or in the command line).
Exemple :

<post-processor3 name="Ensight7PostProcessor" mesh-name="Mesh1" />
  • Add option replacement with parameters on the command line :

To edit an option, take its xpath without the <case> at the beginning and add it on the command line. Example :

<case>
  <case-options-tester>
    <simple-real>3.0</simple-real>
  </case-options-tester>
</case>

Xpath of simple-real is //case/case-options-tester/simple-real.
To edit simple-real, you can add the parameter : ./app -A,//case-options-tester/simple-real=6.0 dataset.arc.
Like symbol replacement, it works with the option types : simple / service (for @name and @mesh-name) / extended / enum.

  • Add support of the optional attribute with the min-occurs attribute :
  • If opt with optional=true/minOccurs=3 :
    • 0 opt => 0 opt after read
    • 1 opt => 3 opt after read (1 in .arc / 2 default)
    • 2 opt => 3 opt after read (2 in .arc / 1 default)
    • &c
  • If opt with optional=false/minOccurs=3 :
    • 0 opt => 3 opt after read (0 in .arc / 3 default)
    • 1 opt => 3 opt after read (1 in .arc / 2 default)
    • 2 opt => 3 opt after read (2 in .arc / 1 default)
    • &c

@AlexlHer AlexlHer added enhancement New feature or request arcane Arcane Component labels Feb 15, 2025
@AlexlHer AlexlHer self-assigned this Feb 15, 2025
Copy link

codecov bot commented Feb 15, 2025

Codecov Report

Attention: Patch coverage is 70.52632% with 224 lines in your changes missing coverage. Please review.

Project coverage is 70.55%. Comparing base (cc00e61) to head (7f80370).
Report is 25 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
arcane/src/arcane/tests/ParameterOptionTest.cc 64.46% 35 Missing and 35 partials ⚠️
...rcane/src/arcane/utils/internal/ParameterOption.cc 82.73% 22 Missing and 7 partials ⚠️
arcane/src/arcane/core/CaseOptionService.cc 70.65% 13 Missing and 14 partials ⚠️
arcane/src/arcane/core/CaseOptionSimple.cc 61.19% 11 Missing and 15 partials ⚠️
arcane/src/arcane/launcher/GeneralHelp.cc 0.00% 22 Missing ⚠️
arcane/src/arcane/core/CaseOptionExtended.cc 62.74% 11 Missing and 8 partials ⚠️
arcane/src/arcane/utils/ParameterList.cc 73.07% 3 Missing and 4 partials ⚠️
arcane/src/arcane/launcher/ArcaneLauncher.cc 0.00% 6 Missing ⚠️
arcane/src/arcane/utils/ParameterCaseOption.cc 91.04% 3 Missing and 3 partials ⚠️
arcane/src/arcane/utils/CommandLineArguments.cc 82.75% 4 Missing and 1 partial ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1988      +/-   ##
==========================================
+ Coverage   70.52%   70.55%   +0.03%     
==========================================
  Files        2286     2291       +5     
  Lines      166934   167619     +685     
  Branches    19186    19314     +128     
==========================================
+ Hits       117726   118265     +539     
- Misses      42196    42264      +68     
- Partials     7012     7090      +78     

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

@AlexlHer AlexlHer force-pushed the dev/ah-extend-stringvariablereplace branch from 3752a13 to b622d43 Compare February 18, 2025 09:05
- For OptionSimple value, OptionService name and mesh-name
- Syntax : -A,say-hello/test-option=1
…ions in command line

- Add it in CaseOptionSimple(Multi) and CaseOptionService(Multi).
…inOccurs/maxOccurs

- If opt with optional=true/minOccurs=3 :
  - 0 opt => 0 opt after read
  - 1 opt => 3 opt after read (1 in .arc / 2 default)
  - 2 opt => 3 opt after read (2 in .arc / 1 default)
  - &c

- If opt with optional=false/minOccurs=3 :
  - 0 opt => 3 opt after read (0 in .arc / 3 default)
  - 1 opt => 3 opt after read (1 in .arc / 2 default)
  - 2 opt => 3 opt after read (2 in .arc / 1 default)
  - &c
…erOption.cc/.h

 - Parameters are parsed once time now (at each options before)
@AlexlHer AlexlHer force-pushed the dev/ah-extend-stringvariablereplace branch from b622d43 to 7f80370 Compare February 18, 2025 09:06
@AlexlHer AlexlHer marked this pull request as ready for review February 18, 2025 09:07
@AlexlHer AlexlHer merged commit b39b8b3 into main Feb 18, 2025
32 checks passed
@AlexlHer AlexlHer deleted the dev/ah-extend-stringvariablereplace branch February 28, 2025 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arcane Arcane Component enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant