From 5c5e5ca29b20877614d9b1c025b86707e67e548b Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Tue, 11 Jan 2022 15:52:58 -0500 Subject: Document how to add a command-line argument --- README-maintainer | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'README-maintainer') diff --git a/README-maintainer b/README-maintainer index 31634229..d5801070 100644 --- a/README-maintainer +++ b/README-maintainer @@ -122,6 +122,31 @@ CODING RULES since those have to get copied around a lot. +HOW TO ADD A COMMAND-LINE ARGUMENT + +Command-line arguments are closely coupled with QPDFJob. To add a new +command-line argument, add the option to the appropriate table in +job.yml. This will automatically declare a method in the private +ArgParser class in QPDFJob_argv.cc which you have to implement. The +implementation should make calls to methods in QPDFJob. + +The build will fail until the new option is documented in +manual/cli.rst. To do that, create documentation for the option by +adding a ".. qpdf:option::" directive followed by a magic help comment +as described at the top of manual/cli.rst. Put this in the correct +help topic. Help topics roughly correspond with sections in that +chapter and are created using a special ".. help-topic" comment. +Follow the example of other options for style. + +When done, the following should happen: + +* qpdf --new-option should work as expected +* qpdf --help=--new-option should show the help from the comment in cli.rst +* qpdf --help=topic should list --new-option for the correct topic +* --new-option should appear in the manual +* --new-option should be in the command-line option index in the manual + + RELEASE PREPARATION * Each year, update copyright notices. This will find all relevant -- cgit v1.2.3-54-g00ecf