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
[SofaPython/core] forward sys.argv to python scripts #368
[SofaPython/core] forward sys.argv to python scripts #368
Conversation
std::cout << "(short name, long name, description, default value)\n-h,\t--help: this help" << std::endl; | ||
std::cout << std::boolalpha; | ||
for( ArgVec::const_iterator a=commands.begin(), aend=commands.end(); a!=aend; ++a ) | ||
(*a)->print(); | ||
std::cout << std::noboolalpha; | ||
|
||
std::cout << "--argv [...]\t" << "forward extra args to the python interpreter" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This help message makes me think --argv
is useful only with python. Isn't it something more generic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR started from discussion in #356, so I sticked to that. I don't quite see where else it could be useful but if needed, extra arguments can be accessed via the static function ArgumentParser::extra_args()
Warning: there are two failing unit tests. |
Note: empty I'm not quite happy with this kind of side-effect, but this matches the previous behaviour so |
build is good, tests are good, gentle bump :-) |
[ci-build] |
…ard-argv [SofaPython/core] forward sys.argv to python scripts (cherry picked from commit da84f5f) # Conflicts: # SofaKernel/framework/sofa/helper/ArgumentParser.cpp
Changelog:
--argv
)SceneLoaderPy
Example:
runSofa -a test.py --argv --spam --bacon eggs # ['test', '--spam', '--bacon', 'eggs']
This PR:
Reviewers will merge only if all these checks are true.