gdal
gdal copied to clipboard
appslib: Remove references to command-line arguments in error messages
What is the bug?
As an example, from ogr2ogr_lib.cpp:
CPLError(
CE_Failure, CPLE_AppDefined,
"Terminating translation prematurely after failed\n"
"translation of layer %s (use -skipfailures to skip "
"errors)",
poFeatureLayer->GetName());
We may be calling GDALVectorTranslate from something other than ogr2ogr, so the -skipfailures option may not exist.
I was thinking perhaps we could have a global PROGRAM_NAME variable or something that's populated by the argument parser. When emitting error messages, we could check PROGRAM_NAME and tailor the text as needed.
Steps to reproduce the issue
none
Versions and provenance
master
Additional context
No response
in ogr2ogr_lib.cpp, I've added a "--invoked-from-gdal-vector-convert" hidden boolean option, but that could potentially be a "--invoked-from=