diff kitten: add options to ignore paths when comparing directories

Tested locally & over SSH:

    $ kitty +kitten diff /local/path /local/path2
    $ kitty +kitten diff /local/path ssh:remote:/path
This commit is contained in:
Suvayu Ali
2022-06-05 00:02:13 +02:00
parent a42200a430
commit fbf1ec43c7
6 changed files with 37 additions and 2 deletions

6
kittens/diff/options/utils.py Normal file → Executable file
View File

@@ -3,7 +3,7 @@
# License: GPLv3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
from typing import Any, Dict, Iterable, Tuple, Union
from typing import Any, Dict, Iterable, List, Tuple, Union
from kitty.conf.utils import (
KeyFuncWrapper, KittensKeyDefinition, parse_kittens_key
@@ -58,6 +58,10 @@ def syntax_aliases(raw: str) -> Dict[str, str]:
return ans
def pattern_list(raw: str) -> List[str]:
return [pat for pat in raw.split(' ') if pat]
def parse_map(val: str) -> Iterable[KittensKeyDefinition]:
x = parse_kittens_key(val, func_with_args.args_funcs)
if x is not None: