Check command line arguments in BlockLabApp
What does this MR do?
This MR improves the handling of command line arguments of BlockLabApp
. Three particular cases now result in sensible exceptions and error messages:
- User does not specify a "command".
- User does not specify a config file path.
- "Command" is not registered/known.
Why was this MR needed?
Omitting command line arguments or specifying the wrong commands has so far always led to segfaults. Through this MR, specific exceptions are thrown, with the main advantage of reporting to the user what went wrong.
Open questions
How to test this? The BlockLabApp
is not part of the tests, as far as I see. I could write a simple Python script that calls a dummy app with several combinations of correct and incorrect arguments, and checks the program output and return value. This would not even require pytest
(but it would be nice if it could).
Edited by Lukas Riedel