diff --git a/flopy4/cli.py b/flopy4/cli.py index d2af30d9..1231740c 100644 --- a/flopy4/cli.py +++ b/flopy4/cli.py @@ -162,15 +162,16 @@ def _cmd_status(args: argparse.Namespace) -> None: exe = shutil.which("mf6") or shutil.which("mf6.exe") binary_version = _query_mf6_version(exe) if exe else None - synced = binary_version is not None and binary_version == MF6_VERSION - status = "(✓ in sync)" if synced else "(! mismatch)" if binary_version else "(not found)" - print(f"flopy4.mf6 synced to : {MF6_VERSION}") print(f"DFN schema version : {DFN_SCHEMA_VERSION}") - if exe: - print(f"Discovered binary : {binary_version} [{exe}] {status}") + if not exe: + print("Discovered binary : (not found on PATH)") + elif binary_version is None: + print(f"Discovered binary : {exe} (version unknown)") else: - print("Discovered binary : none (not found on PATH)") + synced = binary_version == MF6_VERSION and MF6_VERSION != "unknown" + status = "(✓ in sync)" if synced else "(! mismatch)" + print(f"Discovered binary : {binary_version} [{exe}] {status}") def main() -> None: diff --git a/flopy4/mf6/_compat.py b/flopy4/mf6/_compat.py index 63b6ec84..f4d77959 100644 --- a/flopy4/mf6/_compat.py +++ b/flopy4/mf6/_compat.py @@ -3,7 +3,7 @@ import subprocess import warnings -_VERSION_RE = re.compile(r"version\s+([\d]+\.[\d]+\.[\d]+(?:\.\S+)?)", re.I) +_VERSION_RE = re.compile(r"(?:version\s+|mf6:\s+)([\d]+\.[\d]+\.[\d]+(?:\.\S+)?)", re.I) def _query_mf6_version(exe: str) -> str | None: