From 81bcdaf48af9504e0228be56e5bce0dec9c69dfe Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 15 Mar 2018 11:30:31 +0530 Subject: [PATCH] Dont show [options] if there are no options in usage message --- kitty/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kitty/cli.py b/kitty/cli.py index 42d97ffc0..ded55319a 100644 --- a/kitty/cli.py +++ b/kitty/cli.py @@ -286,8 +286,9 @@ def print_help_for_seq(seq, usage, message, appname): lines.append('') a((' ' * leading_indent) + j.join(lines)) - usage = usage or '[program-to-run ...]' - a('{}: {} [options] {}'.format(title('Usage'), bold(yellow(appname)), usage)) + usage = '[program-to-run ...]' if usage is None else usage + optstring = '[options] ' if seq else '' + a('{}: {} {}{}'.format(title('Usage'), bold(yellow(appname)), optstring, usage)) a('') message = message or ( 'Run the |G {appname}| terminal emulator. You can also specify the |_ program| to run inside |_ {appname}| as normal'