Make --override parsing a little more forgiving

Handle option values with = in them even if the user uses a space
as a separator rather than an =
This commit is contained in:
Kovid Goyal 2021-10-18 22:39:44 +05:30
parent a099d2364d
commit 38f1fe7742
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -770,7 +770,8 @@ SYSTEM_CONF = '/etc/xdg/kitty/kitty.conf'
def create_opts(args: CLIOptions, accumulate_bad_lines: Optional[List[BadLineType]] = None) -> KittyOpts:
from .config import load_config
config = tuple(resolve_config(SYSTEM_CONF, defconf, args.config))
overrides = (a.replace('=', ' ', 1) for a in args.override or ())
pat = re.compile(r'^([a-zA-Z0-9_ ]+)=')
overrides = (pat.sub(r'\1 ', a) for a in args.override or ())
opts = load_config(*config, overrides=overrides, accumulate_bad_lines=accumulate_bad_lines)
return opts