Commit 6df62607515cd10bef7634cee1580ad1fc3d542d

Authored by Jay Berkenbilt
1 parent fc1bfe4a

Change default --json from 1 to latest

ChangeLog
1 2022-04-16 Jay Berkenbilt <ejb@ql.org> 1 2022-04-16 Jay Berkenbilt <ejb@ql.org>
2 2
  3 + * Breaking CLI change: the default value for --json is now
  4 + "latest" rather than "1". At this moment, "1" is the latest
  5 + version, but version "2" will be added before the release of
  6 + qpdf 11.
  7 +
3 * Perform code cleanup including some source-compatible but not 8 * Perform code cleanup including some source-compatible but not
4 binary compatible changes to function signatures. 9 binary compatible changes to function signatures.
5 10
@@ -6,7 +6,6 @@ Next @@ -6,7 +6,6 @@ Next
6 * Stay on top of https://github.com/pikepdf/pikepdf/pull/315 6 * Stay on top of https://github.com/pikepdf/pikepdf/pull/315
7 7
8 In order: 8 In order:
9 -* ABI including --json default is latest  
10 * json v2 9 * json v2
11 10
12 Other (do in any order): 11 Other (do in any order):
@@ -480,7 +479,6 @@ This is a list of changes to make next time there is an ABI change. @@ -480,7 +479,6 @@ This is a list of changes to make next time there is an ABI change.
480 Comments appear in the code prefixed by "ABI" 479 Comments appear in the code prefixed by "ABI"
481 480
482 * Search for ABI to find items not listed here. 481 * Search for ABI to find items not listed here.
483 -* Switch default --json to latest  
484 * See where anonymous namespaces can be used to keep things private to 482 * See where anonymous namespaces can be used to keep things private to
485 a source file. Search for `(class|struct)` in **/*.cc. 483 a source file. Search for `(class|struct)` in **/*.cc.
486 * After removing legacy QPDFNameTreeObjectHelper and 484 * After removing legacy QPDFNameTreeObjectHelper and
libqpdf/QPDFJob_config.cc
@@ -234,10 +234,7 @@ QPDFJob::Config::json() @@ -234,10 +234,7 @@ QPDFJob::Config::json()
234 QPDFJob::Config* 234 QPDFJob::Config*
235 QPDFJob::Config::json(std::string const& parameter) 235 QPDFJob::Config::json(std::string const& parameter)
236 { 236 {
237 - if (parameter.empty()) {  
238 - // The default value is 1 for backward compatibility.  
239 - o.m->json_version = 1;  
240 - } else if (parameter == "latest") { 237 + if (parameter.empty() || (parameter == "latest")) {
241 o.m->json_version = 1; 238 o.m->json_version = 1;
242 } else { 239 } else {
243 o.m->json_version = QUtil::string_to_int(parameter.c_str()); 240 o.m->json_version = QUtil::string_to_int(parameter.c_str());
manual/release-notes.rst
@@ -57,6 +57,13 @@ For a detailed list of changes, please see the file @@ -57,6 +57,13 @@ For a detailed list of changes, please see the file
57 ``autopkgtest`` framework but can be used by others. See 57 ``autopkgtest`` framework but can be used by others. See
58 :file:`pkg-test/README.md` for details. 58 :file:`pkg-test/README.md` for details.
59 59
  60 + - CLI: breaking changes
  61 +
  62 + - The default json output version when :qpdf:ref:`--json` is
  63 + specified has been changed from ``1`` to ``latest``.
  64 +
  65 + - API: breaking changes
  66 +
60 - Other changes 67 - Other changes
61 68
62 - A new chapter on contributing to qpdf has been added to the 69 - A new chapter on contributing to qpdf has been added to the