Skip to content

Commit

Permalink
Options: Add tests and doc about alternative syntax (#1118)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwestphal authored Dec 22, 2023
1 parent b3ecf30 commit 2b7b28b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion application/F3DOptionsParser.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ void ConfigurationOptions::GetOptions(F3DAppOptions& appOptions, f3d::options& o
// clang-format off
auto grp0 = cxxOptions.add_options("Applicative");
#ifndef F3D_NO_DEPRECATED
this->DeclareOption(grp0, "input", "", "Input files", deprecatedInputs, LocalHasDefaultNo, MayHaveConfig::YES , "<files>");
this->DeclareOption(grp0, "input", "", "Input files (deprecated)", deprecatedInputs, LocalHasDefaultNo, MayHaveConfig::YES , "<files>");
#endif
this->DeclareOption(grp0, "output", "", "Render to file", appOptions.Output, LocalHasDefaultNo, MayHaveConfig::YES, "<png file>");
this->DeclareOption(grp0, "no-background", "", "No background when render to file", appOptions.NoBackground, HasDefault::YES, MayHaveConfig::YES);
Expand Down
1 change: 1 addition & 0 deletions application/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ f3d_test(NAME TestAnimationIndex DATA InterpolationTest.glb ARGS --animation-ind
f3d_test(NAME TestAnimationAutoplay DATA InterpolationTest.glb ARGS --animation-autoplay DEFAULT_LIGHTS)
f3d_test(NAME TestMaxSizeBelow DATA suzanne.stl ARGS --max-size=1 DEFAULT_LIGHTS)
f3d_test(NAME TestMaxSizeAbove DATA WaterBottle.glb ARGS --max-size=0.2 REGEXP "No file loaded, file is bigger than max size" NO_BASELINE)
f3d_test(NAME TestAlternativeOptionSyntax DATA WaterBottle.glb ARGS --max-size 0.2 REGEXP "No file loaded, file is bigger than max size" NO_BASELINE)
f3d_test(NAME TestNonExistentFile DATA nonExistentFile.vtp ARGS --filename WILL_FAIL)
f3d_test(NAME TestUnsupportedFile DATA unsupportedFile.dummy ARGS --filename WILL_FAIL)
f3d_test(NAME TestComponentName DATA from_abq.vtu ARGS --scalars --bar --comp=2 DEFAULT_LIGHTS)
Expand Down
5 changes: 5 additions & 0 deletions doc/user/OPTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,8 @@ Some rendering options are not compatible between them, here is the precedence o
* Raytracing (`-r`)
* Volume (`-v`)
* Point Sprites (`-o`)

## Options syntax

The `--options=value` syntax is used everywhere in this documentation, however, the syntax `--options value` can also be used, with the exception of options that have implicit values,
`--verbose`, `--comp` and `--scalars`.

0 comments on commit 2b7b28b

Please sign in to comment.