Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs-rst: parse-headers.pl: cleanup the documentation

Keeping both rst and in-file documentation in sync can be harsh.

So, simplify the script's internal documntation to a bare minimum,
and add a mention to the ReST file with its full documentation.

This way, a quick help is still available at the command line,
while the complete one is maintained at the ReST format.

As we won't be using pad2rst anymore, do a cleanup at the ReST
file.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
c3396656 293fbd4f

+12 -126
+3 -19
Documentation/doc-guide/parse-headers.rst
··· 18 18 parse_headers.pl 19 19 ^^^^^^^^^^^^^^^^ 20 20 21 - .. NOTE: the man pages below were generated using pod2rst tool: 22 - .. http://search.cpan.org/~dowens/Pod-POM-View-Restructured-0.02/bin/pod2rst 23 - .. If you need to change anything below this point, please do the changes 24 - .. at parse-headers.pl directly, re-run the script and paste the output of 25 - .. the script here. 26 - 27 - **** 28 21 NAME 29 22 **** 30 23 ··· 26 33 enums and defines and create cross-references to a Sphinx book. 27 34 28 35 29 - ******** 30 36 SYNOPSIS 31 37 ******** 32 38 ··· 35 43 Where <options> can be: --debug, --help or --man. 36 44 37 45 38 - ******* 39 46 OPTIONS 40 47 ******* 41 48 ··· 46 55 47 56 48 57 49 - \ **--help**\ 58 + \ **--usage**\ 50 59 51 60 Prints a brief help message and exits. 52 61 53 62 54 63 55 - \ **--man**\ 64 + \ **--help**\ 56 65 57 - Prints the manual page and exits. 58 - 59 - 66 + Prints a more detailed help message and exits. 60 67 61 68 62 - *********** 63 69 DESCRIPTION 64 70 *********** 65 71 ··· 143 155 144 156 145 157 146 - 147 - ******** 148 158 EXAMPLES 149 159 ******** 150 160 ··· 173 187 symbol at the C domain. 174 188 175 189 176 - **** 177 190 BUGS 178 191 **** 179 192 ··· 180 195 Report bugs to Mauro Carvalho Chehab <mchehab@s-opensource.com> 181 196 182 197 183 - ********* 184 198 COPYRIGHT 185 199 ********* 186 200
+9 -107
Documentation/sphinx/parse-headers.pl
··· 10 10 11 11 GetOptions( 12 12 "debug" => \$debug, 13 - 'help|?' => \$help, 14 - man => \$man 13 + 'usage|?' => \$help, 14 + 'help' => \$man 15 15 ) or pod2usage(2); 16 16 17 17 pod2usage(1) if $help; ··· 354 354 355 355 Put the script in verbose mode, useful for debugging. 356 356 357 - =item B<--help> 357 + =item B<--usage> 358 358 359 359 Prints a brief help message and exits. 360 360 361 - =item B<--man> 361 + =item B<--help> 362 362 363 - Prints the manual page and exits. 363 + Prints a more detailed help message and exits. 364 364 365 365 =back 366 366 ··· 379 379 It is also capable of distinguish #define used for specifying a Linux 380 380 ioctl. 381 381 382 - The EXCEPTIONS_FILE contain two types of statements: B<ignore> or B<replace>. 382 + The EXCEPTIONS_FILE contain two rules to allow ignoring a symbol or 383 + to replace the default references by a custom one. 383 384 384 - The syntax for the ignore tag is: 385 - 386 - =over 8 387 - 388 - ignore B<type> B<name> 389 - 390 - =back 391 - 392 - The B<ignore> means that it won't generate cross references for a 393 - B<name> symbol of type B<type>. 394 - 395 - The syntax for the replace tag is: 396 - 397 - =over 8 398 - 399 - replace B<type> B<name> B<new_value> 400 - 401 - =back 402 - 403 - The B<replace> means that it will generate cross references for a 404 - B<name> symbol of type B<type>, but, instead of using the default 405 - replacement rule, it will use B<new_value>. 406 - 407 - For both statements, B<type> can be either one of the following: 408 - 409 - =over 8 410 - 411 - =item B<ioctl> 412 - 413 - The ignore or replace statement will apply to ioctl definitions like: 414 - 415 - #define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register) 416 - 417 - =item B<define> 418 - 419 - The ignore or replace statement will apply to any other #define found 420 - at C_FILE. 421 - 422 - =item B<typedef> 423 - 424 - The ignore or replace statement will apply to typedef statements at C_FILE. 425 - 426 - =item B<struct> 427 - 428 - The ignore or replace statement will apply to the name of struct statements 429 - at C_FILE. 430 - 431 - =item B<enum> 432 - 433 - The ignore or replace statement will apply to the name of enum statements 434 - at C_FILE. 435 - 436 - =item B<symbol> 437 - 438 - The ignore or replace statement will apply to the name of enum statements 439 - at C_FILE. 440 - 441 - 442 - For replace statements, B<new_value> will automatically use :c:type: 443 - references for B<typedef>, B<enum> and B<struct> types. It will use :ref: 444 - for B<ioctl>, B<define> and B<symbol> types. The type of reference can 445 - also be explicitly defined at the replace statement. 446 - 447 - =back 448 - 449 - =head1 EXAMPLES 450 - 451 - ignore define _VIDEODEV2_H 452 - 453 - =over 8 454 - 455 - 456 - Ignore a #define _VIDEODEV2_H at the C_FILE. 457 - 458 - =back 459 - 460 - ignore symbol PRIVATE 461 - 462 - =over 8 463 - 464 - On a struct like: 465 - 466 - enum foo { BAR1, BAR2, PRIVATE }; 467 - 468 - It won't generate cross-references for B<PRIVATE>. 469 - 470 - =back 471 - 472 - replace symbol BAR1 :c:type:`foo` 473 - replace symbol BAR2 :c:type:`foo` 474 - 475 - =over 8 476 - 477 - On a struct like: 478 - 479 - enum foo { BAR1, BAR2, PRIVATE }; 480 - 481 - It will make the BAR1 and BAR2 enum symbols to cross reference the foo 482 - symbol at the C domain. 483 - 484 - =back 385 + Please read Documentation/doc-guide/parse-headers.rst at the Kernel's 386 + tree for more details. 485 387 486 388 =head1 BUGS 487 389