X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/489d00ed8f4fb90d5788609a474632ab5a16591f..39e9347687618ebefab26df35f770fc85b6173b1:/black.py?ds=sidebyside diff --git a/black.py b/black.py index dd7fe39..37d99bd 100644 --- a/black.py +++ b/black.py @@ -191,7 +191,7 @@ def read_pyproject_toml( return value -@click.command() +@click.command(context_settings=dict(help_option_names=["-h", "--help"])) @click.option( "-l", "--line-length", @@ -2546,7 +2546,7 @@ def normalize_string_quotes(leaf: Leaf) -> None: leaf.value = f"{prefix}{orig_quote}{body}{orig_quote}" new_body = sub_twice(escaped_orig_quote, rf"\1\2{orig_quote}", new_body) new_body = sub_twice(unescaped_new_quote, rf"\1\\{new_quote}", new_body) - if new_quote == '"""' and new_body[-1] == '"': + if new_quote == '"""' and new_body[-1:] == '"': # edge case: new_body = new_body[:-1] + '\\"' orig_escape_count = body.count("\\")