Skip to content
validate.py 527 B
Newer Older
"""Command line options validation module."""

import typing

import click


def _validate_option_use(*cli_args) -> typing.Any:
    """Validate user specified options can work.

    As of current implementation, all options must be used in isolation from
    each other. This validation makes sure that the user is warned about this
    constraint.

decentral1se's avatar
decentral1se committed
    :raises click.UsageError
    """
    if len(list(filter(None, cli_args))) > 1:
        message = 'Cannot use these options together'
decentral1se's avatar
decentral1se committed
        raise click.UsageError(message)