Files
matomo-bootstrap/src/matomo_bootstrap/__main__.py

24 lines
515 B
Python
Raw Normal View History

2025-12-23 11:14:24 +01:00
from .cli import parse_args
from .bootstrap import run_bootstrap
from .errors import BootstrapError
import sys
def main() -> int:
args = parse_args()
try:
token = run_bootstrap(args)
print(token)
return 0
except BootstrapError as exc:
print(f"[ERROR] {exc}", file=sys.stderr)
return 2
except Exception as exc:
print(f"[FATAL] {type(exc).__name__}: {exc}", file=sys.stderr)
return 3
if __name__ == "__main__":
raise SystemExit(main())