import click


def common_serial_options(func):
    """Supply common serial gateway options."""
    func = click.option(
        "-b",
        "--baud",
        default=115200,
        show_default=True,
        type=int,
        help="Baud rate of the serial connection.",
    )(func)
    func = click.option(
        "-p", "--port", required=True, help="Serial port of the gateway."
    )(func)
    return func