"""PIX-8 console entry point."""

import sys
from . import Pix8


def main():
    show_gui = "--nogui" not in sys.argv
    p = Pix8(show_gui=show_gui)

    for arg in sys.argv[1:]:
        if arg.endswith(".py"):
            p.load_cart(arg)
            break

    p.run()


if __name__ == "__main__":
    main()
