]> git.ipfire.org Git - thirdparty/linux.git/commit
docs: parse-headers.py: improve --help logic
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 22 Aug 2025 14:19:15 +0000 (16:19 +0200)
committerJonathan Corbet <corbet@lwn.net>
Fri, 29 Aug 2025 21:54:42 +0000 (15:54 -0600)
commita2d58c917c3e0d0cd161e343261717dbe96ffe22
treecde228290ee0e8d38e15c55156616cdd44275d67
parent8a5a85be4df1ab0642d4a3610691dbaed443d4d0
docs: parse-headers.py: improve --help logic

When printing --help, we'd like the name of the files
from __doc__ to match the displayed positional arguments at
both usage and argument description lines.

Use a custom formatter class to convert ``foo`` into ANSI SGR
code to bold the argument, if is TTY, and adjust the help
text to match the argument names.

Here on Plasma, that makes it display it colored, wich is
really cool. Yet, I opted for SGR, as the best is to follow
the terminal color schema for bold.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/2c1e61d1fb1b2a2838b443beee89c1528831997f.1755872208.git.mchehab+huawei@kernel.org
Documentation/sphinx/parse-headers.py