aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/qpdf/auto_job_init.hh
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-01-06 20:26:41 +0100
committerJay Berkenbilt <ejb@ql.org>2022-01-30 19:11:03 +0100
commit4577df4b5ddf363f5f877fe3b4b4c9ae710c9d55 (patch)
tree7131e6264b33b296962653352ebca5d98ad21147 /libqpdf/qpdf/auto_job_init.hh
parentf1d805badc1ea09998fea9427687456717936ff7 (diff)
downloadqpdf-4577df4b5ddf363f5f877fe3b4b4c9ae710c9d55.tar.zst
QPDFJob increment: generate option table initialization
Diffstat (limited to 'libqpdf/qpdf/auto_job_init.hh')
-rw-r--r--libqpdf/qpdf/auto_job_init.hh150
1 files changed, 150 insertions, 0 deletions
diff --git a/libqpdf/qpdf/auto_job_init.hh b/libqpdf/qpdf/auto_job_init.hh
index b398fabf..8566312f 100644
--- a/libqpdf/qpdf/auto_job_init.hh
+++ b/libqpdf/qpdf/auto_job_init.hh
@@ -3,6 +3,13 @@
// Edits will be automatically overwritten if the build is
// run in maintainer mode.
//
+auto b = [this](void (ArgParser::*f)()) {
+ return QPDFArgParser::bindBare(f, this);
+};
+auto p = [this](void (ArgParser::*f)(char *)) {
+ return QPDFArgParser::bindParam(f, this);
+};
+
char const* yn_choices[] = {"y", "n", 0};
char const* password_mode_choices[] = {"bytes", "hex-bytes", "unicode", "auto", 0};
char const* stream_data_choices[] = {"compress", "preserve", "uncompress", 0};
@@ -13,3 +20,146 @@ char const* flatten_choices[] = {"all", "print", "screen", 0};
char const* json_key_choices[] = {"acroform", "attachments", "encrypt", "objectinfo", "objects", "outlines", "pagelabels", "pages", 0};
char const* print128_choices[] = {"full", "low", "none", 0};
char const* modify128_choices[] = {"all", "annotate", "form", "assembly", "none", 0};
+
+this->ap.selectHelpOptionTable();
+this->ap.addBare("help", b(&ArgParser::argHelp));
+this->ap.addBare("version", b(&ArgParser::argVersion));
+this->ap.addBare("copyright", b(&ArgParser::argCopyright));
+this->ap.addBare("json-help", b(&ArgParser::argJsonHelp));
+this->ap.addBare("show-crypto", b(&ArgParser::argShowCrypto));
+this->ap.selectMainOptionTable();
+this->ap.addPositional(p(&ArgParser::argPositional));
+this->ap.addBare("add-attachment", b(&ArgParser::argAddAttachment));
+this->ap.addBare("allow-weak-crypto", b(&ArgParser::argAllowWeakCrypto));
+this->ap.addBare("check", b(&ArgParser::argCheck));
+this->ap.addBare("check-linearization", b(&ArgParser::argCheckLinearization));
+this->ap.addBare("coalesce-contents", b(&ArgParser::argCoalesceContents));
+this->ap.addBare("copy-attachments-from", b(&ArgParser::argCopyAttachmentsFrom));
+this->ap.addBare("decrypt", b(&ArgParser::argDecrypt));
+this->ap.addBare("deterministic-id", b(&ArgParser::argDeterministicId));
+this->ap.addBare("empty", b(&ArgParser::argEmpty));
+this->ap.addBare("encrypt", b(&ArgParser::argEncrypt));
+this->ap.addBare("externalize-inline-images", b(&ArgParser::argExternalizeInlineImages));
+this->ap.addBare("filtered-stream-data", b(&ArgParser::argFilteredStreamData));
+this->ap.addBare("flatten-rotation", b(&ArgParser::argFlattenRotation));
+this->ap.addBare("generate-appearances", b(&ArgParser::argGenerateAppearances));
+this->ap.addBare("ignore-xref-streams", b(&ArgParser::argIgnoreXrefStreams));
+this->ap.addBare("is-encrypted", b(&ArgParser::argIsEncrypted));
+this->ap.addBare("json", b(&ArgParser::argJson));
+this->ap.addBare("keep-inline-images", b(&ArgParser::argKeepInlineImages));
+this->ap.addBare("linearize", b(&ArgParser::argLinearize));
+this->ap.addBare("list-attachments", b(&ArgParser::argListAttachments));
+this->ap.addBare("newline-before-endstream", b(&ArgParser::argNewlineBeforeEndstream));
+this->ap.addBare("no-original-object-ids", b(&ArgParser::argNoOriginalObjectIds));
+this->ap.addBare("no-warn", b(&ArgParser::argNoWarn));
+this->ap.addBare("optimize-images", b(&ArgParser::argOptimizeImages));
+this->ap.addBare("overlay", b(&ArgParser::argOverlay));
+this->ap.addBare("pages", b(&ArgParser::argPages));
+this->ap.addBare("password-is-hex-key", b(&ArgParser::argPasswordIsHexKey));
+this->ap.addBare("preserve-unreferenced", b(&ArgParser::argPreserveUnreferenced));
+this->ap.addBare("preserve-unreferenced-resources", b(&ArgParser::argPreserveUnreferencedResources));
+this->ap.addBare("progress", b(&ArgParser::argProgress));
+this->ap.addBare("qdf", b(&ArgParser::argQdf));
+this->ap.addBare("raw-stream-data", b(&ArgParser::argRawStreamData));
+this->ap.addBare("recompress-flate", b(&ArgParser::argRecompressFlate));
+this->ap.addBare("remove-page-labels", b(&ArgParser::argRemovePageLabels));
+this->ap.addBare("replace-input", b(&ArgParser::argReplaceInput));
+this->ap.addBare("requires-password", b(&ArgParser::argRequiresPassword));
+this->ap.addBare("show-encryption", b(&ArgParser::argShowEncryption));
+this->ap.addBare("show-encryption-key", b(&ArgParser::argShowEncryptionKey));
+this->ap.addBare("show-linearization", b(&ArgParser::argShowLinearization));
+this->ap.addBare("show-npages", b(&ArgParser::argShowNpages));
+this->ap.addBare("show-pages", b(&ArgParser::argShowPages));
+this->ap.addBare("show-xref", b(&ArgParser::argShowXref));
+this->ap.addBare("static-aes-iv", b(&ArgParser::argStaticAesIv));
+this->ap.addBare("static-id", b(&ArgParser::argStaticId));
+this->ap.addBare("suppress-password-recovery", b(&ArgParser::argSuppressPasswordRecovery));
+this->ap.addBare("suppress-recovery", b(&ArgParser::argSuppressRecovery));
+this->ap.addBare("underlay", b(&ArgParser::argUnderlay));
+this->ap.addBare("verbose", b(&ArgParser::argVerbose));
+this->ap.addBare("warning-exit-0", b(&ArgParser::argWarningExit0));
+this->ap.addBare("with-images", b(&ArgParser::argWithImages));
+this->ap.addOptionalParameter("collate", p(&ArgParser::argCollate));
+this->ap.addOptionalParameter("split-pages", p(&ArgParser::argSplitPages));
+this->ap.addRequiredParameter("compression-level", p(&ArgParser::argCompressionLevel), "level");
+this->ap.addRequiredParameter("copy-encryption", p(&ArgParser::argCopyEncryption), "file");
+this->ap.addRequiredParameter("encryption-file-password", p(&ArgParser::argEncryptionFilePassword), "password");
+this->ap.addRequiredParameter("force-version", p(&ArgParser::argForceVersion), "version");
+this->ap.addRequiredParameter("ii-min-bytes", p(&ArgParser::argIiMinBytes), "minimum");
+this->ap.addRequiredParameter("json-object", p(&ArgParser::argJsonObject), "trailer");
+this->ap.addRequiredParameter("keep-files-open-threshold", p(&ArgParser::argKeepFilesOpenThreshold), "count");
+this->ap.addRequiredParameter("linearize-pass1", p(&ArgParser::argLinearizePass1), "filename");
+this->ap.addRequiredParameter("min-version", p(&ArgParser::argMinVersion), "version");
+this->ap.addRequiredParameter("oi-min-area", p(&ArgParser::argOiMinArea), "minimum");
+this->ap.addRequiredParameter("oi-min-height", p(&ArgParser::argOiMinHeight), "minimum");
+this->ap.addRequiredParameter("oi-min-width", p(&ArgParser::argOiMinWidth), "minimum");
+this->ap.addRequiredParameter("password", p(&ArgParser::argPassword), "password");
+this->ap.addRequiredParameter("password-file", p(&ArgParser::argPasswordFile), "password");
+this->ap.addRequiredParameter("remove-attachment", p(&ArgParser::argRemoveAttachment), "attachment");
+this->ap.addRequiredParameter("rotate", p(&ArgParser::argRotate), "[+|-]angle");
+this->ap.addRequiredParameter("show-attachment", p(&ArgParser::argShowAttachment), "attachment");
+this->ap.addRequiredParameter("show-object", p(&ArgParser::argShowObject), "trailer");
+this->ap.addRequiredChoices("compress-streams", p(&ArgParser::argCompressStreams), yn_choices);
+this->ap.addRequiredChoices("decode-level", p(&ArgParser::argDecodeLevel), decode_level_choices);
+this->ap.addRequiredChoices("flatten-annotations", p(&ArgParser::argFlattenAnnotations), flatten_choices);
+this->ap.addRequiredChoices("json-key", p(&ArgParser::argJsonKey), json_key_choices);
+this->ap.addRequiredChoices("keep-files-open", p(&ArgParser::argKeepFilesOpen), yn_choices);
+this->ap.addRequiredChoices("normalize-content", p(&ArgParser::argNormalizeContent), yn_choices);
+this->ap.addRequiredChoices("object-streams", p(&ArgParser::argObjectStreams), object_streams_choices);
+this->ap.addRequiredChoices("password-mode", p(&ArgParser::argPasswordMode), password_mode_choices);
+this->ap.addRequiredChoices("remove-unreferenced-resources", p(&ArgParser::argRemoveUnreferencedResources), remove_unref_choices);
+this->ap.addRequiredChoices("stream-data", p(&ArgParser::argStreamData), stream_data_choices);
+this->ap.registerOptionTable("pages", b(&ArgParser::argEndPages));
+this->ap.addPositional(p(&ArgParser::argPagesPositional));
+this->ap.addRequiredParameter("password", p(&ArgParser::argPagesPassword), "password");
+this->ap.registerOptionTable("encryption", b(&ArgParser::argEndEncryption));
+this->ap.addPositional(p(&ArgParser::argEncPositional));
+this->ap.registerOptionTable("40-bit encryption", b(&ArgParser::argEnd40BitEncryption));
+this->ap.addRequiredChoices("extract", p(&ArgParser::argEnc40Extract), yn_choices);
+this->ap.addRequiredChoices("annotate", p(&ArgParser::argEnc40Annotate), yn_choices);
+this->ap.addRequiredChoices("print", p(&ArgParser::argEnc40Print), yn_choices);
+this->ap.addRequiredChoices("modify", p(&ArgParser::argEnc40Modify), yn_choices);
+this->ap.registerOptionTable("128-bit encryption", b(&ArgParser::argEnd128BitEncryption));
+this->ap.addBare("cleartext-metadata", b(&ArgParser::argEnc128CleartextMetadata));
+this->ap.addBare("force-V4", b(&ArgParser::argEnc128ForceV4));
+this->ap.addRequiredChoices("accessibility", p(&ArgParser::argEnc128Accessibility), yn_choices);
+this->ap.addRequiredChoices("extract", p(&ArgParser::argEnc128Extract), yn_choices);
+this->ap.addRequiredChoices("print", p(&ArgParser::argEnc128Print), print128_choices);
+this->ap.addRequiredChoices("assemble", p(&ArgParser::argEnc128Assemble), yn_choices);
+this->ap.addRequiredChoices("annotate", p(&ArgParser::argEnc128Annotate), yn_choices);
+this->ap.addRequiredChoices("form", p(&ArgParser::argEnc128Form), yn_choices);
+this->ap.addRequiredChoices("modify-other", p(&ArgParser::argEnc128ModifyOther), yn_choices);
+this->ap.addRequiredChoices("modify", p(&ArgParser::argEnc128Modify), modify128_choices);
+this->ap.addRequiredChoices("use-aes", p(&ArgParser::argEnc128UseAes), yn_choices);
+this->ap.registerOptionTable("256-bit encryption", b(&ArgParser::argEnd256BitEncryption));
+this->ap.addBare("force-R5", b(&ArgParser::argEnc256ForceR5));
+this->ap.addBare("allow-insecure", b(&ArgParser::argEnc256AllowInsecure));
+this->ap.registerOptionTable("underlay/overlay", b(&ArgParser::argEndUnderlayOverlay));
+this->ap.addPositional(p(&ArgParser::argUOPositional));
+this->ap.addRequiredParameter("to", p(&ArgParser::argUOTo), "page-range");
+this->ap.addRequiredParameter("from", p(&ArgParser::argUOFrom), "page-range");
+this->ap.addRequiredParameter("repeat", p(&ArgParser::argUORepeat), "page-range");
+this->ap.addRequiredParameter("password", p(&ArgParser::argUOPassword), "password");
+this->ap.registerOptionTable("attachment", b(&ArgParser::argEndAttachment));
+this->ap.addPositional(p(&ArgParser::argAttPositional));
+this->ap.addBare("replace", b(&ArgParser::argAttReplace));
+this->ap.addRequiredParameter("key", p(&ArgParser::argAttKey), "attachment-key");
+this->ap.addRequiredParameter("filename", p(&ArgParser::argAttFilename), "filename");
+this->ap.addRequiredParameter("creationdate", p(&ArgParser::argAttCreationdate), "creation-date");
+this->ap.addRequiredParameter("moddate", p(&ArgParser::argAttModdate), "modification-date");
+this->ap.addRequiredParameter("mimetype", p(&ArgParser::argAttMimetype), "mime/type");
+this->ap.addRequiredParameter("description", p(&ArgParser::argAttDescription), "description");
+this->ap.registerOptionTable("copy attachment", b(&ArgParser::argEndCopyAttachment));
+this->ap.addPositional(p(&ArgParser::argCopyAttPositional));
+this->ap.addRequiredParameter("prefix", p(&ArgParser::argCopyAttPrefix), "prefix");
+this->ap.addRequiredParameter("password", p(&ArgParser::argCopyAttPassword), "password");
+this->ap.selectOptionTable("256-bit encryption");
+this->ap.copyFromOtherTable("cleartext-metadata", "128-bit encryption");
+this->ap.copyFromOtherTable("accessibility", "128-bit encryption");
+this->ap.copyFromOtherTable("extract", "128-bit encryption");
+this->ap.copyFromOtherTable("print", "128-bit encryption");
+this->ap.copyFromOtherTable("assemble", "128-bit encryption");
+this->ap.copyFromOtherTable("annotate", "128-bit encryption");
+this->ap.copyFromOtherTable("form", "128-bit encryption");
+this->ap.copyFromOtherTable("modify-other", "128-bit encryption");
+this->ap.copyFromOtherTable("modify", "128-bit encryption");