Skip to content

Commit 32e9a42

Browse files
mchehabJonathan Corbet
authored andcommitted
docs: kdoc: move the return values to the helper message
It makes sense to describe what kernel-doc is expected to return on its help message. Move such messages to argparse epilog. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <3bcfa48016770929fcd073376515e3ff0b777ea8.1768823489.git.mchehab+huawei@kernel.org>
1 parent eba6ffd commit 32e9a42

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

tools/docs/kernel-doc

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,20 @@ This option is kept just for backward-compatibility, but it does nothing,
166166
neither here nor at the original Perl script.
167167
"""
168168

169+
EPILOG = """
170+
The return value is:
171+
172+
- 0: success or Python version is not compatible with
173+
kernel-doc. If -Werror is not used, it will also
174+
return 0 if there are issues at kernel-doc markups;
175+
176+
- 1: an abnormal condition happened;
177+
178+
- 2: argparse issued an error;
179+
180+
- 3: When -Werror is used, it means that one or more unfiltered parse
181+
warnings happened.
182+
"""
169183

170184
class MsgFormatter(logging.Formatter):
171185
"""Helper class to format warnings in a similar way to kernel-doc.pl."""
@@ -178,21 +192,10 @@ def main():
178192
"""
179193
Main program.
180194
181-
By default, the return value is:
182-
183-
- 0: success or Python version is not compatible with
184-
kernel-doc. If -Werror is not used, it will also
185-
return 0 if there are issues at kernel-doc markups;
186-
187-
- 1: an abnormal condition happened;
188-
189-
- 2: argparse issued an error;
190-
191-
- 3: -Werror is used, and one or more unfiltered parse warnings happened.
192195
"""
193196

194197
parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter,
195-
description=DESC)
198+
description=DESC, epilog=EPILOG)
196199

197200
#
198201
# Normal arguments

0 commit comments

Comments
 (0)