From 4e5806202542efd3aeff7b662f9ff66bcd63105a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 24 Mar 2020 22:03:00 +0530 Subject: [PATCH] Improve rendering of :option: in cli docs --- kitty/cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kitty/cli.py b/kitty/cli.py index 81883c1bb..45d40f312 100644 --- a/kitty/cli.py +++ b/kitty/cli.py @@ -96,7 +96,9 @@ def opt(text: str) -> str: def option(x: str) -> str: - idx = x.find('-') + idx = x.rfind('--') + if idx < 0: + idx = x.find('-') if idx > -1: x = x[idx:] parts = map(bold, x.split())