-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Should bomb out when given multiple -sql arguments, instead of randomly executing one #9415
Comments
I do not remember any user feedback about surprises with giving multiple Definition of aberrant seems to be "different from what is typical or usual". It is typical and usual for GDAL that users are not protected against giving several times arguments that can be used only once. I do not mean that it is perfect solution to force users to read the documentation. |
All I know is -sql statement1 -sql statement2 is equivalent to -sql 'statement1; statement2;' and that causes an error to be raised. |
Another variation: What error do you see with
... |
Wondering if we shouldn't investigate on using a "standard" argument parser that would provide all the convenient logic, such as erroring out if provided multiple arguments when this is not expected. https://github.com/p-ranav/argparse could be a candidate to investigate |
|
Ok, that seems to happen with the OGRSQL dialect. |
indeed the multiple instances of arguments in various utils has bitten me a few times |
Check of single -sql instance is now effective in ogrinfo, ogr2ogr and gdal_grid which have been converted to the argparse framework. Still remaining gdal_rasterize |
What is the bug?
As per #9394, the programs should bomb out when given multiple -sql arguments, instead of the current behavior of simply "randomly" executing one of them as if that was the only one given.
Stopping it is a better idea than attempting to document this aberrant behavior.
The text was updated successfully, but these errors were encountered: