aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kernel-doc
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2016-05-12 09:15:36 -0400
committerJonathan Corbet <corbet@lwn.net>2016-05-14 11:56:25 -0400
commitfadc0b31cba0bb56bce1a3259cc60e4d7ee67333 (patch)
treef49efd695e60a6a4fd779adfea280cc07afbb493 /scripts/kernel-doc
parent2fd872bd84b3aa1a177a66a8d14bd25f68f373f0 (diff)
kernel-doc: rewrite usage description, remove duplicated comments
Instead of having the kernel-doc usage in both comments and in output to the user, merge them all to one here document. While at it, imrove the text and make it pretty. Give shoemaker's children some shoes. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'scripts/kernel-doc')
-rwxr-xr-xscripts/kernel-doc83
1 files changed, 37 insertions, 46 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index c37255bb620d..29fd5cabb657 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -39,41 +39,43 @@ use strict;
39# 25/07/2012 - Added support for HTML5 39# 25/07/2012 - Added support for HTML5
40# -- Dan Luedtke <mail@danrl.de> 40# -- Dan Luedtke <mail@danrl.de>
41 41
42# 42sub usage {
43# This will read a 'c' file and scan for embedded comments in the 43 my $message = <<"EOF";
44# style of gnome comments (+minor extensions - see below). 44Usage: $0 [OPTION ...] FILE ...
45# 45
46 46Read C language source or header FILEs, extract embedded documentation comments,
47# Note: This only supports 'c'. 47and print formatted documentation to standard output.
48 48
49# usage: 49The documentation comments are identified by "/**" opening comment mark. See
50# kernel-doc [ -docbook | -html | -html5 | -text | -man | -list ] 50Documentation/kernel-doc-nano-HOWTO.txt for the documentation comment syntax.
51# [ -no-doc-sections ] 51
52# [ -function funcname [ -function funcname ...] ] 52Output format selection (mutually exclusive):
53# c file(s)s > outputfile 53 -docbook Output DocBook format.
54# or 54 -html Output HTML format.
55# [ -nofunction funcname [ -function funcname ...] ] 55 -html5 Output HTML5 format.
56# c file(s)s > outputfile 56 -list Output symbol list format. This is for use by docproc.
57# 57 -man Output troff manual page format. This is the default.
58# Set output format using one of -docbook -html -html5 -text or -man. 58 -text Output plain text format.
59# Default is man. 59
60# The -list format is for internal use by docproc. 60Output selection (mutually exclusive):
61# 61 -function NAME Only output documentation for the given function(s)
62# -no-doc-sections 62 or DOC: section title(s). All other functions and DOC:
63# Do not output DOC: sections 63 sections are ignored. May be specified multiple times.
64# 64 -nofunction NAME Do NOT output documentation for the given function(s);
65# -function funcname 65 only output documentation for the other functions and
66# If set, then only generate documentation for the given function(s) or 66 DOC: sections. May be specified multiple times.
67# DOC: section titles. All other functions and DOC: sections are ignored. 67
68# 68Output selection modifiers:
69# -nofunction funcname 69 -no-doc-sections Do not output DOC: sections.
70# If set, then only generate documentation for the other function(s)/DOC: 70
71# sections. Cannot be used together with -function (yes, that's a bug -- 71Other parameters:
72# perl hackers can fix it 8)) 72 -v Verbose output, more warnings and other information.
73# 73 -h Print this help.
74# c files - list of 'c' files to process 74
75# 75EOF
76# All output goes to stdout, with errors to stderr. 76 print $message;
77 exit 1;
78}
77 79
78# 80#
79# format of comments. 81# format of comments.
@@ -437,17 +439,6 @@ while ($ARGV[0] =~ m/^-(.*)/) {
437 439
438# continue execution near EOF; 440# continue execution near EOF;
439 441
440sub usage {
441 print "Usage: $0 [ -docbook | -html | -html5 | -text | -man | -list ]\n";
442 print " [ -no-doc-sections ]\n";
443 print " [ -function funcname [ -function funcname ...] ]\n";
444 print " [ -nofunction funcname [ -nofunction funcname ...] ]\n";
445 print " [ -v ]\n";
446 print " c source file(s) > outputfile\n";
447 print " -v : verbose output, more warnings & other info listed\n";
448 exit 1;
449}
450
451# get kernel version from env 442# get kernel version from env
452sub get_kernel_version() { 443sub get_kernel_version() {
453 my $version = 'unknown kernel version'; 444 my $version = 'unknown kernel version';