Commit 0e909bab8e6eabb96b0bbe8063138d04d5a4ac7f

Authored by Jay Berkenbilt
1 parent 03640247

Improve top-level help information

generate_auto_job
@@ -159,7 +159,7 @@ class Main: @@ -159,7 +159,7 @@ class Main:
159 if long_text == '': 159 if long_text == '':
160 raise Exception(f'missing long text for {topic}') 160 raise Exception(f'missing long text for {topic}')
161 long_text += '\n' 161 long_text += '\n'
162 - if topic != '--help': 162 + if 'help' not in topic:
163 # Help for --help itself has --help=... not 163 # Help for --help itself has --help=... not
164 # referring to specific options. 164 # referring to specific options.
165 for i in re.finditer(r'--help=([^\.\s]+)', long_text): 165 for i in re.finditer(r'--help=([^\.\s]+)', long_text):
job.sums
1 # Generated by generate_auto_job 1 # Generated by generate_auto_job
2 -generate_auto_job bc2f0e8cecebe8b11950cf37714a646fd5a1d294839b748d1c499353226dd642 2 +generate_auto_job 27d219c995864896b1c4a42f303bc3bebb198d9b90d275b727645013c8f6a33e
3 include/qpdf/auto_job_c_att.hh 7ad43bb374c1370ef32ebdcdcb7b73a61d281f7f4e3f12755585872ab30fb60e 3 include/qpdf/auto_job_c_att.hh 7ad43bb374c1370ef32ebdcdcb7b73a61d281f7f4e3f12755585872ab30fb60e
4 include/qpdf/auto_job_c_copy_att.hh 32275d03cdc69b703dd7e02ba0bbe15756e714e9ad185484773a6178dc09e1ee 4 include/qpdf/auto_job_c_copy_att.hh 32275d03cdc69b703dd7e02ba0bbe15756e714e9ad185484773a6178dc09e1ee
5 include/qpdf/auto_job_c_enc.hh 72e138c7b96ed5aacdce78c1dec04b1c20d361faec4f8faf52f64c1d6be99265 5 include/qpdf/auto_job_c_enc.hh 72e138c7b96ed5aacdce78c1dec04b1c20d361faec4f8faf52f64c1d6be99265
@@ -8,8 +8,8 @@ include/qpdf/auto_job_c_pages.hh 931840b329a36ca0e41401190e04537b47f2867671a6643 @@ -8,8 +8,8 @@ include/qpdf/auto_job_c_pages.hh 931840b329a36ca0e41401190e04537b47f2867671a6643
8 include/qpdf/auto_job_c_uo.hh 0585b7de459fa479d9e51a45fa92de0ff6dee748efc9ec1cedd0dde6cee1ad50 8 include/qpdf/auto_job_c_uo.hh 0585b7de459fa479d9e51a45fa92de0ff6dee748efc9ec1cedd0dde6cee1ad50
9 job.yml 1590fd16fd17ed40db9aa56b6713c844cfd61b3a6d0441a3ccd122b7371c68e9 9 job.yml 1590fd16fd17ed40db9aa56b6713c844cfd61b3a6d0441a3ccd122b7371c68e9
10 libqpdf/qpdf/auto_job_decl.hh 9f79396ec459f191be4c5fe34cf88c265cf47355a1a945fa39169d1c94cf04f6 10 libqpdf/qpdf/auto_job_decl.hh 9f79396ec459f191be4c5fe34cf88c265cf47355a1a945fa39169d1c94cf04f6
11 -libqpdf/qpdf/auto_job_help.hh 05cddfb81ed7fb58a8249b912890e560cb76bd51389d64eae6c662ca552c87d9 11 +libqpdf/qpdf/auto_job_help.hh 30dd97f36c6cd748fc53fcb8d864140e32274437ffdf12f609ed04150ad61858
12 libqpdf/qpdf/auto_job_init.hh 3b6323189480a7d782563c9d2b5bc29b8dcd19c6dcc89840b207e38cb503d3f1 12 libqpdf/qpdf/auto_job_init.hh 3b6323189480a7d782563c9d2b5bc29b8dcd19c6dcc89840b207e38cb503d3f1
13 libqpdf/qpdf/auto_job_schema.hh 1c3b4b5488270f8d200ed345573e3a241f15baff6fb7e97ec3d044103b2546d9 13 libqpdf/qpdf/auto_job_schema.hh 1c3b4b5488270f8d200ed345573e3a241f15baff6fb7e97ec3d044103b2546d9
14 manual/_ext/qpdf.py e9ac9d6c70642a3d29281ee5ad92ae2422dee8be9306fb8a0bc9dba0ed5e28f3 14 manual/_ext/qpdf.py e9ac9d6c70642a3d29281ee5ad92ae2422dee8be9306fb8a0bc9dba0ed5e28f3
15 -manual/cli.rst 9aecd2905844fbda5cd528afd7fedef693ac0958bcb20e235f1c8e10a1896abe 15 +manual/cli.rst 1cf74ad0956e51e919287f9dc93574764510856f562333a195775407551958a2
libqpdf/QPDFArgParser.cc
@@ -920,7 +920,7 @@ QPDFArgParser::getTopHelp(std::ostringstream& msg) @@ -920,7 +920,7 @@ QPDFArgParser::getTopHelp(std::ostringstream& msg)
920 msg << "Run \"" << this->m->whoami 920 msg << "Run \"" << this->m->whoami
921 << " --help=topic\" for help on a topic." << std::endl 921 << " --help=topic\" for help on a topic." << std::endl
922 << "Run \"" << this->m->whoami 922 << "Run \"" << this->m->whoami
923 - << " --help=option\" for help on an option." << std::endl 923 + << " --help=--option\" for help on an option." << std::endl
924 << "Run \"" << this->m->whoami 924 << "Run \"" << this->m->whoami
925 << " --help=all\" to see all available help." << std::endl 925 << " --help=all\" to see all available help." << std::endl
926 << std::endl 926 << std::endl
libqpdf/qpdf/auto_job_help.hh
@@ -8,8 +8,8 @@ static void add_help_1(QPDFArgParser&amp; ap) @@ -8,8 +8,8 @@ static void add_help_1(QPDFArgParser&amp; ap)
8 ap.addHelpTopic("usage", "basic invocation", R"(Read a PDF file, apply transformations or modifications, and write 8 ap.addHelpTopic("usage", "basic invocation", R"(Read a PDF file, apply transformations or modifications, and write
9 a new PDF file. 9 a new PDF file.
10 10
11 -Usage: qpdf infile [options] [outfile]  
12 - OR qpdf help-option 11 +Usage: qpdf [infile] [options] [outfile]
  12 + OR qpdf --help[={topic|--option}]
13 13
14 - infile, options, and outfile may be in any order as long as infile 14 - infile, options, and outfile may be in any order as long as infile
15 precedes outfile. 15 precedes outfile.
libtests/qtest/arg_parser/help-all.out
1 Run "arg_parser --help=topic" for help on a topic. 1 Run "arg_parser --help=topic" for help on a topic.
2 -Run "arg_parser --help=option" for help on an option. 2 +Run "arg_parser --help=--option" for help on an option.
3 Run "arg_parser --help=all" to see all available help. 3 Run "arg_parser --help=all" to see all available help.
4 4
5 Topics: 5 Topics:
libtests/qtest/arg_parser/help.out
1 Run "arg_parser --help=topic" for help on a topic. 1 Run "arg_parser --help=topic" for help on a topic.
2 -Run "arg_parser --help=option" for help on an option. 2 +Run "arg_parser --help=--option" for help on an option.
3 Run "arg_parser --help=all" to see all available help. 3 Run "arg_parser --help=all" to see all available help.
4 4
5 Topics: 5 Topics:
manual/cli.rst
@@ -68,8 +68,8 @@ Basic Invocation @@ -68,8 +68,8 @@ Basic Invocation
68 Read a PDF file, apply transformations or modifications, and write 68 Read a PDF file, apply transformations or modifications, and write
69 a new PDF file. 69 a new PDF file.
70 70
71 - Usage: qpdf infile [options] [outfile]  
72 - OR qpdf help-option 71 + Usage: qpdf [infile] [options] [outfile]
  72 + OR qpdf --help[={topic|--option}]
73 73
74 - infile, options, and outfile may be in any order as long as infile 74 - infile, options, and outfile may be in any order as long as infile
75 precedes outfile. 75 precedes outfile.
@@ -84,7 +84,7 @@ Basic Invocation @@ -84,7 +84,7 @@ Basic Invocation
84 84
85 :: 85 ::
86 86
87 - Usage: qpdf infile [options] [outfile] 87 + Usage: qpdf [infile] [options] [outfile]
88 88
89 The :command:`qpdf` command reads the PDF file :samp:`{infile}`, 89 The :command:`qpdf` command reads the PDF file :samp:`{infile}`,
90 applies various transformations or modifications to the file in 90 applies various transformations or modifications to the file in
qpdf/qpdf.cc
@@ -23,7 +23,15 @@ static void usageExit(std::string const&amp; msg) @@ -23,7 +23,15 @@ static void usageExit(std::string const&amp; msg)
23 << std::endl 23 << std::endl
24 << whoami << ": " << msg << std::endl 24 << whoami << ": " << msg << std::endl
25 << std::endl 25 << std::endl
26 - << "For detailed help, run " << whoami << " --help" << std::endl 26 + << "For help:" << std::endl
  27 + << " " << whoami << "--help=usage usage information"
  28 + << std::endl
  29 + << " " << whoami << "--help=topic help on a topic"
  30 + << std::endl
  31 + << " " << whoami << "--help=--option help on an option"
  32 + << std::endl
  33 + << " " << whoami << "--help general help and a topic list"
  34 + << std::endl
27 << std::endl; 35 << std::endl;
28 exit(EXIT_ERROR); 36 exit(EXIT_ERROR);
29 } 37 }
qpdf/qtest/qpdf/split-pages-stdout.out
1 1
2 qpdf: --split-pages may not be used when writing to standard output 2 qpdf: --split-pages may not be used when writing to standard output
3 3
4 -For detailed help, run qpdf --help 4 +For help:
  5 + qpdf--help=usage usage information
  6 + qpdf--help=topic help on a topic
  7 + qpdf--help=--option help on an option
  8 + qpdf--help general help and a topic list
5 9