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

Cli reader options #1860

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

0xfedcafe
Copy link
Contributor

Added a CLI reader option #1735

Copy link

github-actions bot commented Jan 3, 2025

You are modifying libf3d public API! ⚠️Please update bindings accordingly⚠️!
You can find them in their respective directories: python, java, webassembly.

Copy link

codecov bot commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.59%. Comparing base (8d72f2d) to head (bc26894).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1860   +/-   ##
=======================================
  Coverage   95.59%   95.59%           
=======================================
  Files         125      125           
  Lines       10013    10015    +2     
=======================================
+ Hits         9572     9574    +2     
  Misses        441      441           

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

library/options.json Outdated Show resolved Hide resolved
doc/user/OPTIONS.md Outdated Show resolved Hide resolved
@@ -49,7 +49,11 @@ reader* factory::getReader(const std::string& fileName)
{
for (auto r : p->getReaders())
{
if (r->getScore() > bestScore && r->canRead(fileName))
if (forceReader.has_value() && r->getName() == *forceReader)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (forceReader.has_value() && r->getName() == *forceReader)
if (forceReader.has_value() && r->getName() == forceReader.value())

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, since we already check has_value(), should I still switch to forceReader.value() even though it adds a bit of overhead?

@@ -65,6 +65,7 @@ static inline const std::array<CLIGroup, 8> CLIOptions = {{
{ "no-background", "", "No background when render to file", "<bool>", "1" },
{ "help", "h", "Print help", "", "" }, { "version", "", "Print version details", "", "" },
{ "list-readers", "", "Print the list of readers", "", "" },
{"force-reader", "", "Enforce a specific reader", "<reader>", "1"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add an application test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants