aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-02-01 00:40:04 +0100
committerJay Berkenbilt <ejb@ql.org>2022-02-01 00:40:11 +0100
commit5953116634660065510fa5892fcc42d0a3c5e725 (patch)
tree0388adeec8c4caaf0848d316d704e1db95229b86 /libqpdf
parent606420ab5432e6b1dff33798e8ff8572a3ea226a (diff)
downloadqpdf-5953116634660065510fa5892fcc42d0a3c5e725.tar.zst
Clean up documentation and help around json options
Diffstat (limited to 'libqpdf')
-rw-r--r--libqpdf/QPDFJob_argv.cc23
-rw-r--r--libqpdf/qpdf/auto_job_help.hh16
-rw-r--r--libqpdf/qpdf/auto_job_schema.hh4
3 files changed, 13 insertions, 30 deletions
diff --git a/libqpdf/QPDFJob_argv.cc b/libqpdf/QPDFJob_argv.cc
index 66ae02a5..ed37dbce 100644
--- a/libqpdf/QPDFJob_argv.cc
+++ b/libqpdf/QPDFJob_argv.cc
@@ -158,28 +158,7 @@ ArgParser::argCopyright()
void
ArgParser::argJsonHelp()
{
- // Make sure the output looks right on an 80-column display.
- // 1 2 3 4 5 6 7 8
- // 12345678901234567890123456789012345678901234567890123456789012345678901234567890
- std::cout
- << "The json block below contains the same structure with the same keys as the"
- << std::endl
- << "json generated by qpdf. In the block below, the values are descriptions of"
- << std::endl
- << "the meanings of those entries. The specific contract guaranteed by qpdf in"
- << std::endl
- << "its json representation is explained in more detail in the manual. You can"
- << std::endl
- << "specify a subset of top-level keys when you invoke qpdf, but the \"version\""
- << std::endl
- << "and \"parameters\" keys will always be present. Note that the \"encrypt\""
- << std::endl
- << "key's values will be populated for non-encrypted files. Some values will"
- << std::endl
- << "be null, and others will have values that apply to unencrypted files."
- << std::endl
- << QPDFJob::json_out_schema_v1()
- << std::endl;
+ std::cout << QPDFJob::json_out_schema_v1() << std::endl;
}
void
diff --git a/libqpdf/qpdf/auto_job_help.hh b/libqpdf/qpdf/auto_job_help.hh
index 34c6aa8a..49ac3494 100644
--- a/libqpdf/qpdf/auto_job_help.hh
+++ b/libqpdf/qpdf/auto_job_help.hh
@@ -30,7 +30,8 @@ ap.addOptionHelp("--replace-input", "usage", "overwrite input with output", R"(U
ap.addOptionHelp("--job-json-file", "usage", "job JSON file", R"(--job-json-file=file
Specify the name of a file whose contents are expected to
-contain a QPDFJob json file.
+contain a QPDFJob JSON file. Run qpdf --job-json-help for a
+description of the JSON input file format.
)");
ap.addHelpTopic("exit-status", "meanings of qpdf's exit codes", R"(Meaning of exit codes:
@@ -788,15 +789,18 @@ output as binary data. Get the key with --list-attachments.
ap.addHelpTopic("json", "JSON output for PDF information", R"(Show information about the PDF file in JSON format. Please see the
JSON chapter in the qpdf manual for details.
)");
-ap.addOptionHelp("--json", "json", "show file in json format", R"(--json[=version]
+ap.addOptionHelp("--json", "json", "show file in JSON format", R"(--json[=version]
Generate a JSON representation of the file. This is described in
depth in the JSON section of the manual. "version" may be a
-specific version or "latest".
+specific version or "latest". Run qpdf --json-help for a
+description of the generated JSON object.
)");
-ap.addOptionHelp("--json-help", "json", "show format of json output", R"(Describe the format of the JSON output.
+ap.addOptionHelp("--json-help", "json", "show format of JSON output", R"(Describe the format of the JSON output by writing to standard
+output a JSON object with the same keys and with values
+containing descriptive text.
)");
-ap.addOptionHelp("--json-key", "json", "limit which keys are in json output", R"(--json-key=key
+ap.addOptionHelp("--json-key", "json", "limit which keys are in JSON output", R"(--json-key=key
This option is repeatable. If given, only the specified
top-level keys will be included in the JSON output. Otherwise,
@@ -808,7 +812,7 @@ This option is repeatable. If given, only specified objects will
be shown in the "objects" key of the JSON output. Otherwise, all
objects will be shown.
)");
-ap.addOptionHelp("--job-json-help", "json", "show format of job json", R"(Describe the format of the QPDFJob JSON input.
+ap.addOptionHelp("--job-json-help", "json", "show format of job JSON", R"(Describe the format of the QPDFJob JSON input.
)");
ap.addHelpTopic("testing", "options for testing or debugging", R"(The options below are useful when writing automated test code that
includes files created by qpdf or when testing qpdf itself.
diff --git a/libqpdf/qpdf/auto_job_schema.hh b/libqpdf/qpdf/auto_job_schema.hh
index 21a6747a..ca9fc1e1 100644
--- a/libqpdf/qpdf/auto_job_schema.hh
+++ b/libqpdf/qpdf/auto_job_schema.hh
@@ -77,9 +77,9 @@ static constexpr char const* JOB_SCHEMA_DATA = R"({
"withImages": "include image details with showPages",
"listAttachments": "list embedded files",
"showAttachment": "export an embedded file",
- "json": "show file in json format",
+ "json": "show file in JSON format",
"jsonKey": [
- "limit which keys are in json output"
+ "limit which keys are in JSON output"
],
"jsonObject": [
"limit which objects are in JSON"