]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
docs: kdoc: move the return values to the helper message
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 19 Jan 2026 12:05:02 +0000 (13:05 +0100)
committerJonathan Corbet <corbet@lwn.net>
Tue, 20 Jan 2026 22:31:06 +0000 (15:31 -0700)
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>

tools/docs/kernel-doc

index a19a92566780b01bcfa94673459fff3d1477a8d9..902397804e805e972c8a855913f02dba9968fc58 100755 (executable)
@@ -166,6 +166,20 @@ This option is kept just for backward-compatibility, but it does nothing,
 neither here nor at the original Perl script.
 """
 
+EPILOG = """
+The return value is:
+
+- 0: success or Python version is not compatible with
+kernel-doc.  If -Werror is not used, it will also
+return 0 if there are issues at kernel-doc markups;
+
+- 1: an abnormal condition happened;
+
+- 2: argparse issued an error;
+
+- 3: When -Werror is used, it means that one or more unfiltered parse
+     warnings happened.
+"""
 
 class MsgFormatter(logging.Formatter):
     """Helper class to format warnings in a similar way to kernel-doc.pl."""
@@ -178,21 +192,10 @@ def main():
     """
     Main program.
 
-    By default, the return value is:
-
-    - 0: success or Python version is not compatible with
-      kernel-doc.  If -Werror is not used, it will also
-      return 0 if there are issues at kernel-doc markups;
-
-    - 1: an abnormal condition happened;
-
-    - 2: argparse issued an error;
-
-    - 3: -Werror is used, and one or more unfiltered parse warnings happened.
     """
 
     parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter,
-                                     description=DESC)
+                                     description=DESC, epilog=EPILOG)
 
     #
     # Normal arguments