f3d
f3d copied to clipboard
`--dry-run` option is not working
Describe the bug
F3D usually uses a config file, but there is an option to disable this behavior, --dry-run. It seems to be non-functionnal currently
To Reproduce Steps to reproduce the behavior, using a built f3d with BUILD_TESTING enabled:
- Open the file using `f3d --config=config_build --dry-run --verbose
- F3D appears with axis visible, it should not
- Check the output, a config file is read
Expected behavior Config file should not be read
Additional context
in F3DStarter.cxx:655, although the comment says that dry-run is being checked, its actually not. Add the check here by checking the cli option and position the boolean accordingly. Also add a test for it in application/testing/CMakeLists.txt
Would this be the right time to rename this argument to --no-config or something?
--dry-run is used in many CLI applications to mean "run as normal but don't actually write/change anything" so it's a bit confusing (F3D's --no-render is closer to what --dry-run usually means)
Good point @snoyer
Is this issue still open? If it is I would like to work on it.
It is open!
Hum, since you are working on another issue, I'd like to keep this one open for other developpers with no experience on the project if thats ok
sure thats fine
Hey there, this looks interesting, if no one else is working on it, can i pick it up? Thank you so much! @mwestphal
Sounds good! @rehanganapathy , go for it :)
@rehanganapathy any news on this ?
no feedback, unassigning it
Hello!
With this patch, the config value is never set.
application/F3DStarter.cxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/application/F3DStarter.cxx b/application/F3DStarter.cxx
index e1cc563a..6b00c5bc 100644
--- a/application/F3DStarter.cxx
+++ b/application/F3DStarter.cxx
@@ -713,12 +713,16 @@ int F3DStarter::Start(int argc, char** argv)
// but this duplicate the initialization value as it is present in
// F3DOptionTools::DefaultAppOptions too
bool dryRun = false;
+ if (cliOptionsDict.find("dry-run") != cliOptionsDict.end())
+ {
+ dryRun = f3d::options::parse<bool>(cliOptionsDict["dry-run"]);
+ }
if (cliOptionsDict.find("no-render") != cliOptionsDict.end())
{
dryRun = f3d::options::parse<bool>(cliOptionsDict["no-render"]);
}
std::string config;
- if (cliOptionsDict.find("config") != cliOptionsDict.end())
+ if (!dryRun && cliOptionsDict.find("config") != cliOptionsDict.end())
{
config = f3d::options::parse<std::string>(cliOptionsDict["config"]);
}
Is it correct and/or a good starting point?
It is definitely a good starting point! Do you want to open a PR with this patch @t-h2o ?
It is definitely a good starting point! Do you want to open a PR with this patch @t-h2o ?
Done: https://github.com/f3d-app/f3d/pull/1720
That's me, vincenzo. i am getting this issue
Sorry, this issue is not available
That's me, vincenzo. i am getting this issue
You can review the current PR on this issue https://github.com/f3d-app/f3d/pull/1720 if you want
FIxed by #1720