[cling] meta cmd .x should not crash if no file is given
Changes or fixes:
On Ubuntu 22.04 , execute standalone cling binary. In cmd prompt execute .x meta command without giving a filename, cling crashes.
The proposed solution is to directly reject the .x command without giving clear diagnostics. This is not user friendly but this is currently how MetaParser.cpp handles all parsing/input error. At least it prevents crashing.
Checklist:
- [X] tested changes locally
- [ ] updated the docs (if necessary)
Can one of the admins verify this patch?
@phsft-bot build
@Axel-Naumann , @eguiraud Could anyone help reviewing this patch?
Sorry for the slow response. What's the behavior / output when running .x without filename once this PR is applied? If there is absolutely no diagnostic, could you maybe add one as part of this PR? (If not then I will merge this as is - it's still better than crashing!)
Sorry for the slow response. What's the behavior / output when running
.xwithout filename once this PR is applied? If there is absolutely no diagnostic, could you maybe add one as part of this PR? (If not then I will merge this as is - it's still better than crashing!)
After this patch, the outputs are as follows:
[cling]$ .x
input_line_3:2:2: error: expected expression
.x
^