diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-08-09 17:26:47 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-08-09 17:41:23 +0200 |
| commit | 124eb228c464eaf170c03b70fd461fd1a06b82f2 (patch) | |
| tree | f84b40f332c023abc43b5332af8e7b5a154fd4cb /src/apps/projinfo.cpp | |
| parent | f0d766e45640800412c08a7cb9ab4f8823d88d05 (diff) | |
| download | PROJ-124eb228c464eaf170c03b70fd461fd1a06b82f2.tar.gz PROJ-124eb228c464eaf170c03b70fd461fd1a06b82f2.zip | |
projinfo: document PROJJSON output, and add single-line output capability
Diffstat (limited to 'src/apps/projinfo.cpp')
| -rw-r--r-- | src/apps/projinfo.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/apps/projinfo.cpp b/src/apps/projinfo.cpp index 8f3f09b8..1d75efa6 100644 --- a/src/apps/projinfo.cpp +++ b/src/apps/projinfo.cpp @@ -482,8 +482,11 @@ static void outputObject( if (!outputOpt.quiet) { std::cout << "PROJJSON:" << std::endl; } - auto jsonString(JSONExportable->exportToJSON( - JSONFormatter::create(dbContext).get())); + auto formatter(JSONFormatter::create(dbContext)); + if (outputOpt.singleLine) { + formatter->setMultiLine(false); + } + auto jsonString(JSONExportable->exportToJSON(formatter.get())); if (outputOpt.c_ify) { jsonString = c_ify_string(jsonString); } |
