2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 02:49:00 +00:00

QPDFJob: start changing generation for trivial config handlers

This commit is contained in:
Jay Berkenbilt 2022-01-25 06:58:15 -05:00
parent b4b0df0df9
commit f60526aff9
7 changed files with 190 additions and 621 deletions

View File

@ -19,6 +19,58 @@ def warn(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
# QXXXQ
# These need manual handlers.
complex = set([
'add-attachment',
'copy-attachments-from',
'encrypt',
'overlay',
'pages',
'underlay',
])
# QXXXQ
# These are trivial but not in main and so need a different config
# object. Some are in more than one table.
not_yet = set([
'accessibility',
'allow-insecure',
'annotate',
'assemble',
'cleartext-metadata',
'creationdate',
'decode-level',
'description',
'extract',
'filename',
'force-R5',
'force-V4',
'form',
'from',
'job-json-file',
'key',
'mimetype',
'moddate',
'modify',
'modify-other',
'object-streams',
'password',
'password-file',
'password-mode',
'prefix',
'print',
'remove-unreferenced-resources',
'repeat',
'replace',
'rotate',
'show-object',
'stream-data',
'to',
'use-aes',
])
class Main:
SOURCES = [
whoami,
@ -261,6 +313,53 @@ class Main:
self.update_hashes()
# DON'T ADD CODE TO generate AFTER update_hashes
def handle_trivial(self, i, identifier, config, kind, v):
# QXXXQ could potentially generate declarations for config
# methods separately by config object
if kind == 'bare':
self.init.append(f'this->ap.addBare("{i}", '
f'[this](){{{config}.{identifier}();}});')
elif kind == 'optional_parameter':
self.init.append(f'this->ap.addOptionalParameter("{i}", '
f'[this](char *x){{{config}.{identifier}(x);}});')
elif kind == 'required_parameter':
self.init.append(f'this->ap.addRequiredParameter("{i}", '
f'[this](char *x){{{config}.{identifier}(x);}}'
f', "{v}");')
elif kind == 'required_choices':
self.init.append(f'this->ap.addChoices("{i}", '
f'[this](char *x){{{config}.{identifier}(x);}}'
f', true, {v}_choices);')
elif kind == 'optional_choices':
self.init.append(f'this->ap.addChoices("{i}", '
f'[this](char *x){{{config}.{identifier}(x);}}'
f', false, {v}_choices);')
def handle_flag(self, i, identifier, kind, v):
if kind == 'bare':
self.decls.append(f'void {identifier}();')
self.init.append(f'this->ap.addBare("{i}", '
f'b(&ArgParser::{identifier}));')
elif kind == 'optional_parameter':
self.decls.append(f'void {identifier}(char *);')
self.init.append(f'this->ap.addOptionalParameter("{i}", '
f'p(&ArgParser::{identifier}));')
elif kind == 'required_parameter':
self.decls.append(f'void {identifier}(char *);')
self.init.append(f'this->ap.addRequiredParameter("{i}", '
f'p(&ArgParser::{identifier})'
f', "{v}");')
elif kind == 'required_choices':
self.decls.append(f'void {identifier}(char *);')
self.init.append(f'this->ap.addChoices("{i}", '
f'p(&ArgParser::{identifier})'
f', true, {v}_choices);')
elif kind == 'optional_choices':
self.decls.append(f'void {identifier}(char *);')
self.init.append(f'this->ap.addChoices("{i}", '
f'p(&ArgParser::{identifier})'
f', false, {v}_choices);')
def prepare(self, data):
self.decls = []
self.init = []
@ -306,6 +405,7 @@ class Main:
self.decls.append('')
for o in data['options']:
table = o['table']
config = o.get('config', None)
table_prefix = o.get('prefix', table)
if table == 'main':
self.init.append('this->ap.selectMainOptionTable();')
@ -321,44 +421,31 @@ class Main:
self.decls.append(f'void {prefix}Positional(char*);')
self.init.append('this->ap.addPositional('
f'p(&ArgParser::{prefix}Positional));')
flags = {}
for i in o.get('bare', []):
self.options_without_help.add(f'--{i}')
identifier = self.to_identifier(i, prefix, False)
self.decls.append(f'void {identifier}();')
self.init.append(f'this->ap.addBare("{i}", '
f'b(&ArgParser::{identifier}));')
add_jdata(i, table_prefix)
flags[i] = ['bare', None]
for i in o.get('optional_parameter', []):
self.options_without_help.add(f'--{i}')
identifier = self.to_identifier(i, prefix, False)
self.decls.append(f'void {identifier}(char *);')
self.init.append(f'this->ap.addOptionalParameter("{i}", '
f'p(&ArgParser::{identifier}));')
add_jdata(i, table_prefix)
flags[i] = ['optional_parameter', None]
for i, v in o.get('required_parameter', {}).items():
self.options_without_help.add(f'--{i}')
identifier = self.to_identifier(i, prefix, False)
self.decls.append(f'void {identifier}(char *);')
self.init.append(f'this->ap.addRequiredParameter("{i}", '
f'p(&ArgParser::{identifier})'
f', "{v}");')
add_jdata(i, table_prefix)
flags[i] = ['required_parameter', v]
for i, v in o.get('required_choices', {}).items():
self.options_without_help.add(f'--{i}')
identifier = self.to_identifier(i, prefix, False)
self.decls.append(f'void {identifier}(char *);')
self.init.append(f'this->ap.addChoices("{i}", '
f'p(&ArgParser::{identifier})'
f', true, {v}_choices);')
add_jdata(i, table_prefix)
flags[i] = ['required_choices', v]
for i, v in o.get('optional_choices', {}).items():
flags[i] = ['optional_choices', v]
self.options_without_help.add(f'--{i}')
for i, [kind, v] in flags.items():
self.options_without_help.add(f'--{i}')
identifier = self.to_identifier(i, prefix, False)
self.decls.append(f'void {identifier}(char *);')
self.init.append(f'this->ap.addChoices("{i}", '
f'p(&ArgParser::{identifier})'
f', false, {v}_choices);')
add_jdata(i, table_prefix)
# QXXXQ complex, not_yet
if i in complex or i in not_yet or config is None:
identifier = self.to_identifier(i, prefix, False)
self.handle_flag(i, identifier, kind, v)
else:
identifier = self.to_identifier(i, '', False)
self.handle_trivial(i, identifier, config, kind, v)
if table not in ('main', 'help'):
identifier = self.to_identifier(table, 'argEnd', False)
self.decls.append(f'void {identifier}();')
@ -465,7 +552,7 @@ class Main:
['choices', 'options', 'no-json', 'json']))
for o in data['options']:
self.check_keys('top', o, set(
['table', 'prefix', 'bare', 'positional',
['table', 'prefix', 'config', 'bare', 'positional',
'optional_parameter', 'required_parameter',
'required_choices', 'optional_choices', 'from_table']))

View File

@ -105,6 +105,7 @@ class QPDFJob
{
friend class QPDFJob;
public:
// QXXXQ could potentially generate these declarations
QPDF_DLL Config& allowWeakCrypto();
QPDF_DLL Config& check();
QPDF_DLL Config& checkLinearization();

View File

@ -1,9 +1,9 @@
# Generated by generate_auto_job
generate_auto_job 0758b244fc4e2d3e440883072d2740bc4cdb26c5aa8de938f028afd7d83fad79
job.yml 78d3b655abe70c0baaa31e51b74931f97084632bca5961fdbae89d7a57f34a67
libqpdf/qpdf/auto_job_decl.hh 9fda0ebd93bce6e308a3f26181293ad7b0d88a3503d4955cbf8e1db9a884d8ee
generate_auto_job ea845318af6d4226761f7534c489e4abe0c5f4864b2fee10c8a16f11034b4d34
job.yml 2752b11028530f127b06e9731834dc3ae4c3b13d0161608e3b258cd2a79767d7
libqpdf/qpdf/auto_job_decl.hh db95ca0864e7495532095cd193be1ff0c15797b9ccaf252024c1154bae57b365
libqpdf/qpdf/auto_job_help.hh 383eea80e2c185ef5295fc126246457a7ceeffea759fdb90bb2e6727532ea538
libqpdf/qpdf/auto_job_init.hh a16e89fc7be3ca200d47391d949628a92113533135758068b944b64d0d54793d
libqpdf/qpdf/auto_job_init.hh 864bb0a01df93bff129e7bc1723611d4e73f20ef7b0e33bd52261811eee43e2f
libqpdf/qpdf/auto_job_schema.hh c91a4e182e088797b70dda94af03ca32d360f3564890132da2a8bdc3c4432423
manual/_ext/qpdf.py 855fe12de5af7a10bb24be6ecc4d5dff4c84ac58cf388a13be6bbb394346a67d
manual/cli.rst 68122ff8179c10df3fe6d577adde4973c346f7866ba9a511bab5a6e6f292a6f1

View File

@ -60,6 +60,7 @@ options:
- show-crypto
- job-json-help
- table: main
config: jc
positional: true
bare:
- add-attachment

View File

@ -215,20 +215,6 @@ ArgParser::argPasswordFile(char* parameter)
}
}
void
ArgParser::argEmpty()
{
// QXXXQ @TRIVIAL
jc.empty();
}
void
ArgParser::argLinearize()
{
// QXXXQ @TRIVIAL
jc.linearize();
}
void
ArgParser::argEncrypt()
{
@ -287,27 +273,6 @@ ArgParser::argEncPositional(char* arg)
}
}
void
ArgParser::argDecrypt()
{
// QXXXQ @TRIVIAL
jc.decrypt();
}
void
ArgParser::argPasswordIsHexKey()
{
// QXXXQ @TRIVIAL
jc.passwordIsHexKey();
}
void
ArgParser::argSuppressPasswordRecovery()
{
// QXXXQ @TRIVIAL
jc.suppressPasswordRecovery();
}
void
ArgParser::argPasswordMode(char* parameter)
{
@ -339,34 +304,6 @@ ArgParser::argEnc256AllowInsecure()
o.allow_insecure = true;
}
void
ArgParser::argAllowWeakCrypto()
{
// QXXXQ @TRIVIAL
jc.allowWeakCrypto();
}
void
ArgParser::argCopyEncryption(char* parameter)
{
// QXXXQ @TRIVIAL
jc.copyEncryption(parameter);
}
void
ArgParser::argEncryptionFilePassword(char* parameter)
{
// QXXXQ @TRIVIAL
jc.encryptionFilePassword(parameter);
}
void
ArgParser::argCollate(char* parameter)
{
// QXXXQ @TRIVIAL
jc.collate(parameter);
}
void
ArgParser::argPages()
{
@ -504,34 +441,6 @@ ArgParser::argRotate(char* parameter)
parseRotationParameter(parameter);
}
void
ArgParser::argFlattenRotation()
{
// QXXXQ @TRIVIAL
jc.flattenRotation();
}
void
ArgParser::argListAttachments()
{
// QXXXQ @TRIVIAL
jc.listAttachments();
}
void
ArgParser::argShowAttachment(char* parameter)
{
// QXXXQ @TRIVIAL
jc.showAttachment(parameter);
}
void
ArgParser::argRemoveAttachment(char* parameter)
{
// QXXXQ @TRIVIAL
jc.removeAttachment(parameter);
}
void
ArgParser::argAddAttachment()
{
@ -570,27 +479,6 @@ ArgParser::argStreamData(char* parameter)
}
}
void
ArgParser::argCompressStreams(char* parameter)
{
// QXXXQ @TRIVIAL
jc.compressStreams(parameter);
}
void
ArgParser::argRecompressFlate()
{
// QXXXQ @TRIVIAL
jc.recompressFlate();
}
void
ArgParser::argCompressionLevel(char* parameter)
{
// QXXXQ @TRIVIAL
jc.compressionLevel(parameter);
}
void
ArgParser::argDecodeLevel(char* parameter)
{
@ -619,20 +507,6 @@ ArgParser::argDecodeLevel(char* parameter)
}
}
void
ArgParser::argNormalizeContent(char* parameter)
{
// QXXXQ @TRIVIAL
jc.normalizeContent(parameter);
}
void
ArgParser::argSuppressRecovery()
{
// QXXXQ @TRIVIAL
jc.suppressRecovery();
}
void
ArgParser::argObjectStreams(char* parameter)
{
@ -657,34 +531,6 @@ ArgParser::argObjectStreams(char* parameter)
}
}
void
ArgParser::argIgnoreXrefStreams()
{
// QXXXQ @TRIVIAL
jc.ignoreXrefStreams();
}
void
ArgParser::argQdf()
{
// QXXXQ @TRIVIAL
jc.qdf();
}
void
ArgParser::argPreserveUnreferenced()
{
// QXXXQ @TRIVIAL
jc.preserveUnreferenced();
}
void
ArgParser::argPreserveUnreferencedResources()
{
// QXXXQ @TRIVIAL
jc.preserveUnreferencedResources();
}
void
ArgParser::argRemoveUnreferencedResources(char* parameter)
{
@ -708,167 +554,6 @@ ArgParser::argRemoveUnreferencedResources(char* parameter)
}
}
void
ArgParser::argKeepFilesOpen(char* parameter)
{
// QXXXQ @TRIVIAL
jc.keepFilesOpen(parameter);
}
void
ArgParser::argKeepFilesOpenThreshold(char* parameter)
{
// QXXXQ @TRIVIAL
jc.keepFilesOpenThreshold(parameter);
}
void
ArgParser::argNewlineBeforeEndstream()
{
// QXXXQ @TRIVIAL
jc.newlineBeforeEndstream();
}
void
ArgParser::argLinearizePass1(char* parameter)
{
// QXXXQ @TRIVIAL
jc.linearizePass1(parameter);
}
void
ArgParser::argCoalesceContents()
{
// QXXXQ @TRIVIAL
jc.coalesceContents();
}
void
ArgParser::argFlattenAnnotations(char* parameter)
{
// QXXXQ @TRIVIAL
jc.flattenAnnotations(parameter);
}
void
ArgParser::argGenerateAppearances()
{
// QXXXQ @TRIVIAL
jc.generateAppearances();
}
void
ArgParser::argMinVersion(char* parameter)
{
// QXXXQ @TRIVIAL
jc.minVersion(parameter);
}
void
ArgParser::argForceVersion(char* parameter)
{
// QXXXQ @TRIVIAL
jc.forceVersion(parameter);
}
void
ArgParser::argSplitPages(char* parameter)
{
// QXXXQ @TRIVIAL
jc.splitPages(parameter);
}
void
ArgParser::argVerbose()
{
// QXXXQ @TRIVIAL
jc.verbose();
}
void
ArgParser::argProgress()
{
// QXXXQ @TRIVIAL
jc.progress();
}
void
ArgParser::argNoWarn()
{
// QXXXQ @TRIVIAL
jc.noWarn();
}
void
ArgParser::argWarningExit0()
{
// QXXXQ @TRIVIAL
jc.warningExit0();
}
void
ArgParser::argDeterministicId()
{
// QXXXQ @TRIVIAL
jc.deterministicId();
}
void
ArgParser::argStaticId()
{
// QXXXQ @TRIVIAL
jc.staticId();
}
void
ArgParser::argStaticAesIv()
{
// QXXXQ @TRIVIAL
jc.staticAesIv();
}
void
ArgParser::argNoOriginalObjectIds()
{
// QXXXQ @TRIVIAL
jc.noOriginalObjectIds();
}
void
ArgParser::argShowEncryption()
{
// QXXXQ @TRIVIAL
jc.showEncryption();
}
void
ArgParser::argShowEncryptionKey()
{
// QXXXQ @TRIVIAL
jc.showEncryptionKey();
}
void
ArgParser::argCheckLinearization()
{
// QXXXQ @TRIVIAL
jc.checkLinearization();
}
void
ArgParser::argShowLinearization()
{
// QXXXQ @TRIVIAL
jc.showLinearization();
}
void
ArgParser::argShowXref()
{
// QXXXQ @TRIVIAL
jc.showXref();
}
void
ArgParser::argShowObject(char* parameter)
{
@ -876,125 +561,6 @@ ArgParser::argShowObject(char* parameter)
o.require_outfile = false;
}
void
ArgParser::argRawStreamData()
{
// QXXXQ @TRIVIAL
jc.rawStreamData();
}
void
ArgParser::argFilteredStreamData()
{
// QXXXQ @TRIVIAL
jc.filteredStreamData();
}
void
ArgParser::argShowNpages()
{
// QXXXQ @TRIVIAL
jc.showNpages();
}
void
ArgParser::argShowPages()
{
// QXXXQ @TRIVIAL
jc.showPages();
}
void
ArgParser::argWithImages()
{
// QXXXQ @TRIVIAL
jc.withImages();
}
void
ArgParser::argJson()
{
// QXXXQ @TRIVIAL
jc.json();
}
void
ArgParser::argJsonKey(char* parameter)
{
// QXXXQ @TRIVIAL
jc.jsonKey(parameter);
}
void
ArgParser::argJsonObject(char* parameter)
{
// QXXXQ @TRIVIAL
jc.jsonObject(parameter);
}
void
ArgParser::argCheck()
{
// QXXXQ @TRIVIAL
jc.check();
}
void
ArgParser::argOptimizeImages()
{
// QXXXQ @TRIVIAL
jc.optimizeImages();
}
void
ArgParser::argExternalizeInlineImages()
{
// QXXXQ @TRIVIAL
jc.externalizeInlineImages();
}
void
ArgParser::argKeepInlineImages()
{
// QXXXQ @TRIVIAL
jc.keepInlineImages();
}
void
ArgParser::argRemovePageLabels()
{
// QXXXQ @TRIVIAL
jc.removePageLabels();
}
void
ArgParser::argOiMinWidth(char* parameter)
{
// QXXXQ @TRIVIAL
jc.oiMinWidth(parameter);
}
void
ArgParser::argOiMinHeight(char* parameter)
{
// QXXXQ @TRIVIAL
jc.oiMinHeight(parameter);
}
void
ArgParser::argOiMinArea(char* parameter)
{
// QXXXQ @TRIVIAL
jc.oiMinArea(parameter);
}
void
ArgParser::argIiMinBytes(char* parameter)
{
// QXXXQ @TRIVIAL
jc.iiMinBytes(parameter);
}
void
ArgParser::argEnc40Print(char* parameter)
{
@ -1226,27 +792,6 @@ ArgParser::argEndUnderlayOverlay()
o.under_overlay = 0;
}
void
ArgParser::argReplaceInput()
{
// QXXXQ @TRIVIAL
jc.replaceInput();
}
void
ArgParser::argIsEncrypted()
{
// QXXXQ @TRIVIAL
jc.isEncrypted();
}
void
ArgParser::argRequiresPassword()
{
// QXXXQ @TRIVIAL
jc.requiresPassword();
}
void
ArgParser::argAttPositional(char* arg)
{

View File

@ -19,82 +19,17 @@ void argShowCrypto();
void argJobJsonHelp();
void argPositional(char*);
void argAddAttachment();
void argAllowWeakCrypto();
void argCheck();
void argCheckLinearization();
void argCoalesceContents();
void argCopyAttachmentsFrom();
void argDecrypt();
void argDeterministicId();
void argEmpty();
void argEncrypt();
void argExternalizeInlineImages();
void argFilteredStreamData();
void argFlattenRotation();
void argGenerateAppearances();
void argIgnoreXrefStreams();
void argIsEncrypted();
void argJson();
void argKeepInlineImages();
void argLinearize();
void argListAttachments();
void argNewlineBeforeEndstream();
void argNoOriginalObjectIds();
void argNoWarn();
void argOptimizeImages();
void argOverlay();
void argPages();
void argPasswordIsHexKey();
void argPreserveUnreferenced();
void argPreserveUnreferencedResources();
void argProgress();
void argQdf();
void argRawStreamData();
void argRecompressFlate();
void argRemovePageLabels();
void argReplaceInput();
void argRequiresPassword();
void argShowEncryption();
void argShowEncryptionKey();
void argShowLinearization();
void argShowNpages();
void argShowPages();
void argShowXref();
void argStaticAesIv();
void argStaticId();
void argSuppressPasswordRecovery();
void argSuppressRecovery();
void argUnderlay();
void argVerbose();
void argWarningExit0();
void argWithImages();
void argCollate(char *);
void argSplitPages(char *);
void argCompressionLevel(char *);
void argCopyEncryption(char *);
void argEncryptionFilePassword(char *);
void argForceVersion(char *);
void argIiMinBytes(char *);
void argJobJsonFile(char *);
void argJsonObject(char *);
void argKeepFilesOpenThreshold(char *);
void argLinearizePass1(char *);
void argMinVersion(char *);
void argOiMinArea(char *);
void argOiMinHeight(char *);
void argOiMinWidth(char *);
void argPassword(char *);
void argPasswordFile(char *);
void argRemoveAttachment(char *);
void argRotate(char *);
void argShowAttachment(char *);
void argShowObject(char *);
void argCompressStreams(char *);
void argDecodeLevel(char *);
void argFlattenAnnotations(char *);
void argJsonKey(char *);
void argKeepFilesOpen(char *);
void argNormalizeContent(char *);
void argObjectStreams(char *);
void argPasswordMode(char *);
void argRemoveUnreferencedResources(char *);

View File

@ -30,82 +30,82 @@ this->ap.addBare("job-json-help", b(&ArgParser::argJobJsonHelp));
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("allow-weak-crypto", [this](){jc.allowWeakCrypto();});
this->ap.addBare("check", [this](){jc.check();});
this->ap.addBare("check-linearization", [this](){jc.checkLinearization();});
this->ap.addBare("coalesce-contents", [this](){jc.coalesceContents();});
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("decrypt", [this](){jc.decrypt();});
this->ap.addBare("deterministic-id", [this](){jc.deterministicId();});
this->ap.addBare("empty", [this](){jc.empty();});
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("externalize-inline-images", [this](){jc.externalizeInlineImages();});
this->ap.addBare("filtered-stream-data", [this](){jc.filteredStreamData();});
this->ap.addBare("flatten-rotation", [this](){jc.flattenRotation();});
this->ap.addBare("generate-appearances", [this](){jc.generateAppearances();});
this->ap.addBare("ignore-xref-streams", [this](){jc.ignoreXrefStreams();});
this->ap.addBare("is-encrypted", [this](){jc.isEncrypted();});
this->ap.addBare("json", [this](){jc.json();});
this->ap.addBare("keep-inline-images", [this](){jc.keepInlineImages();});
this->ap.addBare("linearize", [this](){jc.linearize();});
this->ap.addBare("list-attachments", [this](){jc.listAttachments();});
this->ap.addBare("newline-before-endstream", [this](){jc.newlineBeforeEndstream();});
this->ap.addBare("no-original-object-ids", [this](){jc.noOriginalObjectIds();});
this->ap.addBare("no-warn", [this](){jc.noWarn();});
this->ap.addBare("optimize-images", [this](){jc.optimizeImages();});
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("password-is-hex-key", [this](){jc.passwordIsHexKey();});
this->ap.addBare("preserve-unreferenced", [this](){jc.preserveUnreferenced();});
this->ap.addBare("preserve-unreferenced-resources", [this](){jc.preserveUnreferencedResources();});
this->ap.addBare("progress", [this](){jc.progress();});
this->ap.addBare("qdf", [this](){jc.qdf();});
this->ap.addBare("raw-stream-data", [this](){jc.rawStreamData();});
this->ap.addBare("recompress-flate", [this](){jc.recompressFlate();});
this->ap.addBare("remove-page-labels", [this](){jc.removePageLabels();});
this->ap.addBare("replace-input", [this](){jc.replaceInput();});
this->ap.addBare("requires-password", [this](){jc.requiresPassword();});
this->ap.addBare("show-encryption", [this](){jc.showEncryption();});
this->ap.addBare("show-encryption-key", [this](){jc.showEncryptionKey();});
this->ap.addBare("show-linearization", [this](){jc.showLinearization();});
this->ap.addBare("show-npages", [this](){jc.showNpages();});
this->ap.addBare("show-pages", [this](){jc.showPages();});
this->ap.addBare("show-xref", [this](){jc.showXref();});
this->ap.addBare("static-aes-iv", [this](){jc.staticAesIv();});
this->ap.addBare("static-id", [this](){jc.staticId();});
this->ap.addBare("suppress-password-recovery", [this](){jc.suppressPasswordRecovery();});
this->ap.addBare("suppress-recovery", [this](){jc.suppressRecovery();});
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.addBare("verbose", [this](){jc.verbose();});
this->ap.addBare("warning-exit-0", [this](){jc.warningExit0();});
this->ap.addBare("with-images", [this](){jc.withImages();});
this->ap.addOptionalParameter("collate", [this](char *x){jc.collate(x);});
this->ap.addOptionalParameter("split-pages", [this](char *x){jc.splitPages(x);});
this->ap.addRequiredParameter("compression-level", [this](char *x){jc.compressionLevel(x);}, "level");
this->ap.addRequiredParameter("copy-encryption", [this](char *x){jc.copyEncryption(x);}, "file");
this->ap.addRequiredParameter("encryption-file-password", [this](char *x){jc.encryptionFilePassword(x);}, "password");
this->ap.addRequiredParameter("force-version", [this](char *x){jc.forceVersion(x);}, "version");
this->ap.addRequiredParameter("ii-min-bytes", [this](char *x){jc.iiMinBytes(x);}, "minimum");
this->ap.addRequiredParameter("job-json-file", p(&ArgParser::argJobJsonFile), "file");
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("json-object", [this](char *x){jc.jsonObject(x);}, "trailer");
this->ap.addRequiredParameter("keep-files-open-threshold", [this](char *x){jc.keepFilesOpenThreshold(x);}, "count");
this->ap.addRequiredParameter("linearize-pass1", [this](char *x){jc.linearizePass1(x);}, "filename");
this->ap.addRequiredParameter("min-version", [this](char *x){jc.minVersion(x);}, "version");
this->ap.addRequiredParameter("oi-min-area", [this](char *x){jc.oiMinArea(x);}, "minimum");
this->ap.addRequiredParameter("oi-min-height", [this](char *x){jc.oiMinHeight(x);}, "minimum");
this->ap.addRequiredParameter("oi-min-width", [this](char *x){jc.oiMinWidth(x);}, "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("remove-attachment", [this](char *x){jc.removeAttachment(x);}, "attachment");
this->ap.addRequiredParameter("rotate", p(&ArgParser::argRotate), "[+|-]angle");
this->ap.addRequiredParameter("show-attachment", p(&ArgParser::argShowAttachment), "attachment");
this->ap.addRequiredParameter("show-attachment", [this](char *x){jc.showAttachment(x);}, "attachment");
this->ap.addRequiredParameter("show-object", p(&ArgParser::argShowObject), "trailer");
this->ap.addChoices("compress-streams", p(&ArgParser::argCompressStreams), true, yn_choices);
this->ap.addChoices("compress-streams", [this](char *x){jc.compressStreams(x);}, true, yn_choices);
this->ap.addChoices("decode-level", p(&ArgParser::argDecodeLevel), true, decode_level_choices);
this->ap.addChoices("flatten-annotations", p(&ArgParser::argFlattenAnnotations), true, flatten_choices);
this->ap.addChoices("json-key", p(&ArgParser::argJsonKey), true, json_key_choices);
this->ap.addChoices("keep-files-open", p(&ArgParser::argKeepFilesOpen), true, yn_choices);
this->ap.addChoices("normalize-content", p(&ArgParser::argNormalizeContent), true, yn_choices);
this->ap.addChoices("flatten-annotations", [this](char *x){jc.flattenAnnotations(x);}, true, flatten_choices);
this->ap.addChoices("json-key", [this](char *x){jc.jsonKey(x);}, true, json_key_choices);
this->ap.addChoices("keep-files-open", [this](char *x){jc.keepFilesOpen(x);}, true, yn_choices);
this->ap.addChoices("normalize-content", [this](char *x){jc.normalizeContent(x);}, true, yn_choices);
this->ap.addChoices("object-streams", p(&ArgParser::argObjectStreams), true, object_streams_choices);
this->ap.addChoices("password-mode", p(&ArgParser::argPasswordMode), true, password_mode_choices);
this->ap.addChoices("remove-unreferenced-resources", p(&ArgParser::argRemoveUnreferencedResources), true, remove_unref_choices);