You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

32 lines
997 B

from typing import List, Optional
def main(argv: Optional[List[str]] = None) -> int:
"""CLI wrapper that delegates to scripts.mindmodel.validator.main.
Returns the integer exit code from the delegated main. If the
validator module is not available or raises, return a non-zero
exit code.
"""
try:
# Import here to avoid side-effects on module import
from scripts.mindmodel import validator
# Call the validator.main if present
if hasattr(validator, "main"):
result = validator.main(argv)
# Ensure we return an int
try:
return int(result) # type: ignore
except Exception:
return 1
else:
return 2
except Exception:
# Import error or runtime error — return non-zero so callers
# can detect failure (tests expect non-zero on missing manifest)
return 2
if __name__ == "__main__":
raise SystemExit(main())