#!/usr/bin/env python
# pylint: disable=invalid-name
'''
CLI script for the Rocket R 60V.
'''

import sys

from rocket_r60v.machine import Machine
from rocket_r60v.cli import CLI
from rocket_r60v.exceptions import RocketError


if __name__ == '__main__':

    machine = Machine()
    cli     = CLI(machine)

    try:
        data = cli.execute()
        if data:
            sys.stdout.write(f'{data}\n')

    except RocketError as ex:
        sys.stderr.write(f'{ex}\n')
        sys.exit(1)
