[gdal-dev] question about --config cmd line option

Victor Chernetsky victor at amigocloud.com
Wed Oct 18 11:40:55 PDT 2017


Hello,

I am developing the AmigoCloud driver for GDAL, and I have a question about
'-config' command line option.

When I use a space it seems to work, but when I use '=', which seems like a
correct way of doing it, I get the token string with unwanted chars at the
end of it.

Here is how I call it with space. I get good result:
victor$ ./apps/ogrinfo --config AMIGOCLOUD_API_KEY MY_TOKEN -al
"AmigoCloud:14200"
AMIGOCLOUD_API_KEY: 'MY_TOKEN'

When I call it with '=' it's not good:
victor$ ./apps/ogrinfo --config AMIGOCLOUD_API_KEY=MY_TOKEN -al
"AmigoCloud:14200"
AMIGOCLOUD_API_KEY: 'MY_TOKEN=-al'

This is the code I use to get the token:

osAPIKey = CSLFetchNameValueDef(papszOpenOptionsIn, "AMIGOCLOUD_API_KEY",
                                CPLGetConfigOption("AMIGOCLOUD_API_KEY", ""));

printf("AMIGOCLOUD_API_KEY: '%s'\n", osAPIKey.c_str());

Am I doing something wrong in my code, or the space is the way to go?

Thanks,
*Victor Chernetsky*


+1 (408) 368-4607
victor at amigocloud.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171018/fa72f2bd/attachment.html>


More information about the gdal-dev mailing list