blob: 6d16e4cb12016f9f0939d3cdcd9eb330798ecaf9 (
plain)
1
2
3
4
5
6
7
8
9
10
|
"""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.")
|