"""CLI options validators.""" from pathlib import Path def directory_exists(val: str) -> Path: """Check that directory path specified actually exists.""" _dir = Path(val).absolute() if _dir.is_dir() and _dir.exists(): return _dir raise FileNotFoundError(f"The path '{_dir}' MUST exist and be a directory.")