#!/usr/bin/env python

from pypon import ind as i
from pypon import device_info as d
import click


@click.group()
def main():
    """ponctl - Command-line utility for managing PON whiteboxes"""
    pass


@main.command()
@click.argument('olt_host_port')
@click.option('--broker', '-b', help='Kafka broker in the form of HOST:PORT')
def ind(olt_host_port, broker):
    """Get device info from OLT and, optionally,
        send them to Kafka BROKER. OLT and BROKER are in the
        form of HOST:PORT."""
    i.Indications(olt_host_port, broker).start()


@main.command()
@click.argument('olt_host_port')
def devinfo(olt_host_port):
    """Get device info from OLT_HOST_PORT."""
    d.DeviceInfo(olt_host_port).start()


if __name__ == "__main__":
    main()
