#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Command line interface (CLI) for version info, etc.
#
# Note:
# - Based on wrapper scripts from Anaconda (e.g., ~/anaconda3/envs/nlp-py-3-9/bin/python/pytest).
# - This is currently just used to trace out path and version info.
# - A warning is shown if invoked in non-debug mode.
#
## UPDATE 29 Aug 26: uses new client arg to mezcla_main
#

"""Wrapper for mezcla module info display"""

import re
import sys
from pathlib import Path

if __name__ == '__main__':
    # Ensure this checkout of mezcla is used (not another installed copy).
    repo_root = str(Path(__file__).resolve().parent.parent)
    sys.path.insert(0, repo_root)

    # Invoke the package entry point in mezcla.__main__.
    # note: applies standard workaround for Windows invocation quirks
    from mezcla import debug
    from mezcla.__main__ import main as mezcla_main
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    ##
    ## OLD:
    ## skip_warnings = debug.debugging()
    ## sys.exit(mezcla_main(omit_warnings=skip_warnings))
    ##
    sys.exit(mezcla_main(client=True))
