commit: 3e9c92ef1ea53b15974c730e5709ccb08a309dea
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 9 13:30:32 2022 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Dec 9 13:30:32 2022 +0000
URL:
https://gitweb.gentoo.org/proj/pkgcore/snakeoil.git/commit/?id=3e9c92ef
generate_man_rsts: better formatting for options
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
src/snakeoil/dist/generate_man_rsts.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/snakeoil/dist/generate_man_rsts.py
b/src/snakeoil/dist/generate_man_rsts.py
index 6c482211..ca20b360 100644
--- a/src/snakeoil/dist/generate_man_rsts.py
+++ b/src/snakeoil/dist/generate_man_rsts.py
@@ -34,6 +34,10 @@ class RawTextFormatter(argparse.RawTextHelpFormatter):
action.help = '\n' + action.help.strip()
return super()._format_action(action)
+ def _format_action_invocation(self, action):
+ text = super()._format_action_invocation(action)
+ return f':option:`{text}`'
+
class ManConverter:
"""Convert argparse help docs into rST man pages."""