Better error message when user does not specify strategy for disabling ligatures

This commit is contained in:
Kovid Goyal 2020-01-28 15:23:08 +05:30
parent 644ee646a2
commit 60835871eb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1273,9 +1273,13 @@ def cmd_disable_ligatures(global_opts, opts, args):
match_tab: Tab to change opacity in
all: Boolean indicating operate on all windows
'''
if not args:
raise SystemExit(
'You must specify the STRATEGY for disabling ligatures, must be one of'
' never, always or cursor')
strategy = args[0]
if strategy not in ('never', 'always', 'cursor'):
raise ValueError('{} is not a valid disable_ligatures strategy'.format('strategy'))
raise SystemExit('{} is not a valid disable_ligatures strategy'.format('strategy'))
return {
'strategy': strategy, 'match_window': opts.match, 'match_tab': opts.match_tab,
'all': opts.all,