return config_parse_path
-def match_path_exists(path: Path, value: str) -> bool:
- return path.parent.joinpath(value).exists()
+def match_path_exists(value: str) -> bool:
+ if not value:
+ return False
+
+ return Path(value).exists()
@dataclasses.dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class MkosiMatch:
name: str
- match: Callable[[Path, str], bool]
+ match: Callable[[str], bool]
class CustomHelpFormatter(argparse.HelpFormatter):
return
elif (m := self.match_lookup.get(k)):
- if not m.match(path, v):
+ if not m.match(v):
return
parser.remove_section("Match")