Skip to content

Commit

Permalink
[runsofa] Allowing multiple argv (#4591)
Browse files Browse the repository at this point in the history
[runsofa] allow multiple argv
  • Loading branch information
EulalieCoevoet committed Mar 26, 2024
1 parent 042ca17 commit aa1e30a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Sofa/GUI/Common/src/sofa/gui/common/ArgumentParser.cpp
Expand Up @@ -81,6 +81,7 @@ void ArgumentParser::parse()
std::vector<cxxopts::KeyValue> vecArg;
try
{
extra.clear();
m_options.parse_positional("input-file");
const auto temp = m_options.parse(copyArgc, copyArgv);
vecArg = temp.arguments();
Expand All @@ -95,8 +96,6 @@ void ArgumentParser::parse()
for (const auto& arg : vecArg)
{
m_parseResult[arg.key()] = arg.value();
if(arg.key() == "argv")
extra.push_back(arg.value());

//go through all possible keys (because of the short/long names)
for (const auto& callback : m_mapCallbacks)
Expand Down
2 changes: 1 addition & 1 deletion applications/projects/runSofa/Main.cpp
Expand Up @@ -304,7 +304,7 @@ int main(int argc, char** argv)
"enable interactive mode for the GUI which includes idle and mouse events (EXPERIMENTAL)"
);
argParser->addArgument(
cxxopts::value<std::vector<std::string> >(),
cxxopts::value<std::vector<std::string> >(sofa::gui::common::ArgumentParser::extra),
"argv",
"forward extra args to the python interpreter"
);
Expand Down

0 comments on commit aa1e30a

Please sign in to comment.